Skip to content

Commit f61dc56

Browse files
committed
fix: determining app is updated logic
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 7f2ac96 commit f61dc56

File tree

1 file changed

+5
-9
lines changed
  • apps/renderer/src/initialize/migrates

1 file changed

+5
-9
lines changed

apps/renderer/src/initialize/migrates/index.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@ declare global {
1111
}
1212

1313
export const doMigration = async () => {
14-
const lastVersion = localStorage.getItem(appVersionKey)
15-
if (!lastVersion || lastVersion === APP_VERSION) {
16-
if (!lastVersion) {
17-
localStorage.setItem(appVersionKey, APP_VERSION)
18-
}
19-
return
20-
}
14+
const lastVersion = localStorage.getItem(appVersionKey) || APP_VERSION
15+
localStorage.setItem(appVersionKey, APP_VERSION)
16+
17+
if (lastVersion === APP_VERSION) return
18+
2119
// NOTE: Add migration logic here
2220

2321
if (!APP_VERSION.includes("nightly")) {
2422
window.__app_is_upgraded__ = true
2523
}
2624
appLog(`Upgrade from ${lastVersion} to ${APP_VERSION}`)
27-
28-
localStorage.setItem(appVersionKey, APP_VERSION)
2925
}

0 commit comments

Comments
 (0)