Update the badge on start up.

This commit is contained in:
Bauke 2022-03-16 11:20:29 +01:00
parent 1489da6101
commit adab28447d
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,7 @@
import browser from 'webextension-polyfill'; import browser from 'webextension-polyfill';
import {Settings} from '../settings/settings.js';
import {updateBadge} from '../utilities/badge.js';
import {History} from '../utilities/history.js'; import {History} from '../utilities/history.js';
import {browserActionClicked} from './browser-action.js'; import {browserActionClicked} from './browser-action.js';
import {initializeContextMenus} from './context-menus.js'; import {initializeContextMenus} from './context-menus.js';
@ -7,6 +9,7 @@ import {initializeContextMenus} from './context-menus.js';
browser.runtime.onStartup.addListener(async () => { browser.runtime.onStartup.addListener(async () => {
console.debug('Clearing history.'); console.debug('Clearing history.');
await History.clear(); await History.clear();
await updateBadge(await Settings.fromSyncStorage());
}); });
browser.browserAction.onClicked.addListener(browserActionClicked); browser.browserAction.onClicked.addListener(browserActionClicked);