Skip to content

Commit

Permalink
chore: store app version
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Aug 21, 2024
1 parent f44b733 commit 124b0bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/renderer/src/initialize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { repository } from "@pkg"
import { getUISettings } from "@renderer/atoms/settings/ui"
import { isElectronBuild } from "@renderer/constants"
import { browserDB } from "@renderer/database"
import { getStorageNS } from "@renderer/lib/ns"
import { InvalidateQueryEvent } from "@renderer/providers/invalidate-query-provider"
import { CleanerService } from "@renderer/services/cleaner"
import { registerGlobalContext } from "@shared/bridge"
Expand Down Expand Up @@ -44,6 +45,9 @@ declare global {
version: string
}
}

const appVersionKey = getStorageNS("app_version")

export const initializeApp = async () => {
appLog(`${APP_NAME}: Next generation information browser`, repository.url)
appLog(`Initialize ${APP_NAME}...`)
Expand All @@ -56,6 +60,14 @@ export const initializeApp = async () => {
"electron" :
"web"

const lastVersion = localStorage.getItem(appVersionKey)

if (lastVersion && lastVersion !== APP_VERSION) {
appLog(`Upgrade from ${lastVersion} to ${APP_VERSION}`)
// TODO
}
localStorage.setItem(appVersionKey, APP_VERSION)

// Initialize dayjs
dayjs.extend(duration)
dayjs.extend(relativeTime)
Expand Down

0 comments on commit 124b0bd

Please sign in to comment.