Skip to content

Commit a576a09

Browse files
authored
Fix login race condition when service worker wakes (#308) (#321)
Add ensureOptionsLoaded() to browser action click handler to ensure login state is loaded from storage before checking isLoggedIn. This fixes a race condition where clicking the extension icon could redirect to login even when already authenticated, because the service worker's in-memory state wasn't restored before the handler executed.
1 parent 262035c commit a576a09

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/scripts/core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ browser.webRequest.onCompleted.addListener(async function (details) {
192192
}, {urls: ["*://*.feedly.com/v3/tags*global.saved*"]});
193193

194194
browser.action.onClicked.addListener(async function () {
195+
await ensureOptionsLoaded();
195196
if (appGlobal.isLoggedIn) {
196197
await openFeedlyTab();
197198
if(appGlobal.options.resetCounterOnClick){

0 commit comments

Comments
 (0)