From 130d4f28bce229c0a537cace14c1aa55caecb912 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 9 Nov 2024 14:42:40 +0200 Subject: [PATCH] Fix bug that caused some events to be missed --- packages/main/src/handlers/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/main/src/handlers/index.ts b/packages/main/src/handlers/index.ts index 61bc2670..81364cf8 100644 --- a/packages/main/src/handlers/index.ts +++ b/packages/main/src/handlers/index.ts @@ -68,11 +68,11 @@ export const registerHandlers = () => { ipcMain.on('scrape', async (event: IpcMainEvent) => { const config = await getConfig(); const eventSubscriber = new BudgetTrackingEventEmitter(); - scrapeAndUpdateOutputVendors(config, eventSubscriber); - setPeriodicScrapingIfNeeded(config, eventSubscriber); eventSubscriber.onAny((eventName, eventData) => { event.reply('scrapingProgress', JSON.stringify({ eventName, eventData })); }); + await setPeriodicScrapingIfNeeded(config, eventSubscriber); + await scrapeAndUpdateOutputVendors(config, eventSubscriber); }); ipcMain.removeAllListeners('getYnabAccountData');