File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,25 +228,6 @@ browser.runtime.onInstalled.addListener(async (details) => {
228228} ) ;
229229
230230const init = async ( ) => {
231- browser . storage . onChanged . addListener ( ( changes , area ) => {
232- if ( area === 'local' && changes . disableBadge ) {
233- try {
234- handleStorageChange ( changes ) ;
235- }
236- catch ( error ) {
237- console . error ( error ) ;
238- }
239- }
240- } ) ;
241- browser . menus . onClicked . addListener ( ( {
242- menuItemId, checked,
243- } ) => {
244- if ( menuItemId === 'badge' ) {
245- browser . storage . local . set ( {
246- disableBadge : ! checked ,
247- } ) ;
248- }
249- } ) ;
250231 const count = await manager . getInstances ( ) ;
251232 if ( count ) {
252233 await setupNotificationWorkers ( ) ;
@@ -256,6 +237,27 @@ const init = async () => {
256237 }
257238} ;
258239
240+ browser . storage . onChanged . addListener ( ( changes , area ) => {
241+ if ( area === 'local' && changes . disableBadge ) {
242+ try {
243+ handleStorageChange ( changes ) ;
244+ }
245+ catch ( error ) {
246+ console . error ( error ) ;
247+ }
248+ }
249+ } ) ;
250+
251+ browser . menus . onClicked . addListener ( ( {
252+ menuItemId, checked,
253+ } ) => {
254+ if ( menuItemId === 'badge' ) {
255+ browser . storage . local . set ( {
256+ disableBadge : ! checked ,
257+ } ) ;
258+ }
259+ } ) ;
260+
259261globalThis . requestIdleCallback ( async ( ) => {
260262 for ( const [
261263 id ,
You can’t perform that action at this time.
0 commit comments