@@ -2,6 +2,8 @@ import { Creator, loadCreators as _loadCreators, creatorHasNebulaVideo, creatorH
22import { purgeCache , purgeCacheIfNecessary } from './background/ext' ;
33import type { CreatorSettings } from './content/nebula/creator-settings' ;
44import { BrowserMessage , getBase , getBrowserInstance , getFromStorage , isChrome , nebulavideo , parseTimeString , parseTypeObject , setToStorage , toTimeString } from './helpers/sharedExt' ;
5+ import { repairPlayerSettings } from './options/player' ;
6+ import { Settings } from './page/components' ;
57
68const videoFetchYt = 50 ;
79const videoFetchNebula = 50 ;
@@ -66,7 +68,7 @@ getBrowserInstance().runtime.onInstalled.addListener(async (details) => {
6668 await local . clear ( ) ;
6769 }
6870
69- const { hiddenCreators, creatorSettings } = await getFromStorage ( { hiddenCreators : [ ] as string [ ] , creatorSettings : { } as Record < string , CreatorSettings > } ) ;
71+ const { hiddenCreators, creatorSettings, playerSettings } = await getFromStorage ( { hiddenCreators : [ ] as string [ ] , creatorSettings : { } as Record < string , CreatorSettings > , playerSettings : { } as Partial < Settings > } ) ;
7072 if ( Array . isArray ( hiddenCreators ) && hiddenCreators . length ) {
7173 for ( let c of hiddenCreators ) {
7274 if ( c . endsWith ( '/' ) ) c = c . slice ( 0 , - 1 ) ;
@@ -76,6 +78,8 @@ getBrowserInstance().runtime.onInstalled.addListener(async (details) => {
7678 await setToStorage ( { creatorSettings } ) ;
7779 await ( sync || local ) . remove ( 'hiddenCreators' ) ;
7880 }
81+ repairPlayerSettings ( playerSettings ) ;
82+ await setToStorage ( { playerSettings } ) ;
7983
8084 if ( details . reason === 'install' ) openOptions ( true , 'show-changelogs' ) ;
8185} ) ;
0 commit comments