v0.5.1: 修复缓存/FM/翻译/Linux等问题

This commit is contained in:
2026-05-25 19:38:48 +08:00
parent 65ed71503e
commit 6da544cffb
16 changed files with 147 additions and 33 deletions

View File

@ -44,13 +44,13 @@
<script setup lang="ts">
defineOptions({ name: 'DiscoverView' });
import { ref, onMounted, watch } from 'vue';
import { ref, onMounted, onActivated, watch } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { invoke } from '@tauri-apps/api/core';
import { usePlayerStore } from '../stores/player';
import SongListItem from '../components/SongListItem.vue';
import { normalizeSong, type Song } from '../utils/song';
import { pageCacheGet, pageCacheSet, pageCacheInvalidate } from '../composables/usePageCache';
import { pageCacheGet, pageCacheSet, pageCacheInvalidate, pageCacheIsStale } from '../composables/usePageCache';
import { useOnlineStatus } from '../composables/useOnlineStatus';
const router = useRouter();
@ -89,6 +89,10 @@ onMounted(async () => {
}
});
onActivated(() => {
if (pageCacheIsStale('discover_hotTags')) loadHotTags();
});
watch(isOnline, (val, old) => {
if (val && !old && hotTags.value.length === 0) {
pageCacheInvalidate('discover_hotTags');