fix(frontend): refresh file storage stats on tab and page revisit

Set stats query staleTime to 0 with refetchOnMount always, and unmount
inactive file admin tabs so returning to the stats view triggers a new fetch
instead of serving the 30s React Query cache.
This commit is contained in:
ryan
2026-06-18 15:13:09 +08:00
parent 990e3a6f51
commit 83b5475d69
2 changed files with 10 additions and 25 deletions
+3 -3
View File
@@ -42,16 +42,16 @@ export default function FilesPage() {
{/* ──────── TAB 1: 统计看板 ──────── */}
<TabsContent value="stats" className="outline-hidden">
<FileStats />
{activeTab === "stats" ? <FileStats /> : null}
</TabsContent>
{/* ──────── TAB 2: 文件列表 ──────── */}
<TabsContent value="list" className="outline-hidden">
<FileList />
{activeTab === "list" ? <FileList /> : null}
</TabsContent>
<TabsContent value="storage" className="outline-hidden">
<StorageConfigTab />
{activeTab === "storage" ? <StorageConfigTab /> : null}
</TabsContent>
</Tabs>
</motion.div>