From 564ee1f7c6dc0dd163654586004b8bceab623cba Mon Sep 17 00:00:00 2001 From: navorite Date: Tue, 14 Nov 2023 14:13:32 +0200 Subject: [PATCH] fix: Autosaved sessions did not show up real-time --- src/background/background.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/background/background.ts b/src/background/background.ts index a9d99ff3..621c6cf3 100644 --- a/src/background/background.ts +++ b/src/background/background.ts @@ -45,12 +45,12 @@ browser.alarms.onAlarm.addListener(async (alarm) => { if (count > autoSaveMaxSessions) sessionsDB.deleteLastAutosavedSession(count - autoSaveMaxSessions); - const sessions = sessionsDB.lazyLoadSessions(); - - sendMessage({ - message: 'notifyChangeDB', - sessions: await sessions, - selectedId: selectionId + sessionsDB.streamSessions('dateSaved', (sessions) => { + sendMessage({ + message: 'notifyChangeDB', + sessions, + selectedId: selectionId + }); }); } });