From b4afd3fa07116c9900575aefae2dae7b9065f6d9 Mon Sep 17 00:00:00 2001 From: Erek Speed Date: Thu, 6 May 2021 20:39:19 +0900 Subject: [PATCH] fix: Reset badge text to empty on extension startup (#462) For some reason, chrome restores the previous badge state on restart causing inconsistency with actual rikaikun state. TESTED=Loaded unpacked extension and used chrome://restart to ensure badge text reset. Fixes #82 --- extension/background.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extension/background.ts b/extension/background.ts index 96d137ccd..e499cefb9 100644 --- a/extension/background.ts +++ b/extension/background.ts @@ -47,6 +47,10 @@ chrome.runtime.onMessage.addListener(function (request, sender, response) { } }); +// Clear browser action badge text on first load +// Chrome preserves last state which is usually 'On' +chrome.browserAction.setBadgeText({ text: '' }); + rcxMain.config = {}; const optionsList = [