fix: the detection logic of the new version

This commit is contained in:
zyronon
2025-09-15 00:33:36 +08:00
parent 12a22baf2b
commit 14ca910066
5 changed files with 12 additions and 7 deletions

View File

@@ -58,9 +58,11 @@ async function init() {
store.load = true
setTheme(settingStore.theme)
get(APP_VERSION.key).then(r => {
runtimeStore.isNew = r ? (APP_VERSION.version > Number(r)) : true
})
if (!settingStore.first) {
get(APP_VERSION.key).then(r => {
runtimeStore.isNew = r ? (APP_VERSION.version > Number(r)) : true
})
}
}
onMounted(init)

View File

@@ -443,5 +443,5 @@ a {
}
.red-point {
@apply bg-red w-3 h-3 rounded-full absolute right-5;
@apply bg-red w-3 h-3 rounded-full absolute right-3;
}

View File

@@ -40,7 +40,7 @@ const {toggleTheme} = useTheme()
<div class="row" @click="router.push('/setting')">
<IconFluentSettings20Regular/>
<span v-if="settingStore.sideExpand">设置</span>
<div class="red-point" v-if="runtimeStore.isNew"></div>
<div class="red-point" :class="!settingStore.sideExpand && 'top-1 right-0'" v-if="runtimeStore.isNew"></div>
</div>
</div>
<div class="bottom flex justify-evenly ">
@@ -100,7 +100,7 @@ const {toggleTheme} = useTheme()
svg {
flex-shrink: 0;
font-size: 1.5rem !important;
font-size: 1.3rem !important;
}
}

View File

@@ -119,7 +119,6 @@ export const useSettingStore = defineStore('setting', {
}
let data = checkAndUpgradeSaveSetting(configStr)
this.setState({...data, load: true})
// this.load = true
resolve(true)
})
}