mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 21:29:08 +00:00
Indicate in the desktop if the user gets rate limited for indexing
This commit is contained in:
@@ -198,6 +198,11 @@ function pushDataToKhoj (regenerate = false) {
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
if (error.response.status == 429) {
|
||||
const win = BrowserWindow.getAllWindows()[0];
|
||||
if (win) win.webContents.send('needsSubscription', true);
|
||||
if (win) win.webContents.send('update-state', state);
|
||||
}
|
||||
state['completed'] = false
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -396,6 +401,11 @@ app.whenReady().then(() => {
|
||||
event.reply('update-state', arg);
|
||||
});
|
||||
|
||||
ipcMain.on('needsSubscription', (event, arg) => {
|
||||
console.log(arg);
|
||||
event.reply('needsSubscription', arg);
|
||||
});
|
||||
|
||||
ipcMain.on('navigate', (event, page) => {
|
||||
win.loadFile(page);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user