import { storageHelper } from 'utils/storageHelper' ; import { Migration , onConfigOutdated } from '.' ; export const migration = { version : '3.0.0' , async migrate ( version ) { type ConfigBeforeMigrate = { copySnippetButton : boolean ; } ; type ConfigAfterMigrate = { copySnippetButton : boolean ; } ; await onConfigOutdated ( version , async ( configs ) => { const key = 'platform_github.com' ; const config = configs [ key ] ; if ( typeof config === 'object' && config !== null && 'copySnippetButton' in config ) { const configBeforeMigrate = config ; const { copySnippetButton , ... rest } = configBeforeMigrate ; if ( copySnippetButton ) { const configAfterMigrate = { ... rest , copySnippetButton : false , } ; await storageHelper . set ( { [ key ] : configAfterMigrate , } ) ; } } } ) ; } , } ;