mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-04-20 10:57:28 +08:00
feat: 修复menu每次都刷新的问题
This commit is contained in:
@@ -167,7 +167,7 @@ export default {
|
|||||||
notificationState.unreadCount = 0
|
notificationState.unreadCount = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await updateCount()
|
|
||||||
watch(() => authState.loggedIn, async () => {
|
watch(() => authState.loggedIn, async () => {
|
||||||
await updateCount()
|
await updateCount()
|
||||||
})
|
})
|
||||||
@@ -189,6 +189,9 @@ export default {
|
|||||||
} catch { /* ignore */ }
|
} catch { /* ignore */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.isLoadingCategory = !cachedCategories
|
||||||
|
this.isLoadingTag = !cachedTags
|
||||||
|
|
||||||
const fetchCategories = () => {
|
const fetchCategories = () => {
|
||||||
fetch(`${API_BASE_URL}/api/categories`).then(res => {
|
fetch(`${API_BASE_URL}/api/categories`).then(res => {
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
@@ -213,9 +216,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isLoadingCategory = !cachedCategories
|
|
||||||
this.isLoadingTag = !cachedTags
|
|
||||||
|
|
||||||
if (cachedCategories) {
|
if (cachedCategories) {
|
||||||
setTimeout(fetchCategories, 1500)
|
setTimeout(fetchCategories, 1500)
|
||||||
} else {
|
} else {
|
||||||
@@ -227,6 +227,8 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
fetchTags()
|
fetchTags()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await updateCount()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
cycleTheme,
|
cycleTheme,
|
||||||
|
|||||||
Reference in New Issue
Block a user