fix: wait for migrations

This commit is contained in:
EnixCoda 2021-05-31 18:39:25 +08:00
parent 345c5cec99
commit 0038b32271
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD
3 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ export const migration: Migration = {
accessToken?: string
}
onConfigOutdated(version, async configs => {
await onConfigOutdated(version, async configs => {
for (const key of Object.keys(configs)) {
if (
typeof configs[key] === 'object' &&

View file

@ -12,7 +12,7 @@ export const migration: Migration = {
copySnippetButton: boolean
}
onConfigOutdated(version, async configs => {
await onConfigOutdated(version, async configs => {
const key = 'platform_github.com'
const config = configs[key]
if (typeof config === 'object' && config !== null && 'copySnippetButton' in config) {

View file

@ -26,7 +26,7 @@ export async function onConfigOutdated<T extends { [key: string]: any }>(
if (config && config.configVersion < configVersion) {
const { configVersion, ...restConfig } = config
runIfOutdated(restConfig as T)
await runIfOutdated(restConfig as T)
await storageHelper.set({ configVersion })
}
}