Indicate in the desktop if the user gets rate limited for indexing

This commit is contained in:
sabaimran
2023-11-25 22:31:23 -08:00
parent 73e38fccf3
commit 52b88de7f4
4 changed files with 27 additions and 1 deletions

View File

@@ -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);
});