mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-16 15:06:04 +08:00
fix(dashboard): preserve data tab memory when leaving workspace
This commit is contained in:
@@ -41,9 +41,10 @@ const tabs = computed(() => [
|
||||
|
||||
const activeTab = computed(() => String(route.meta.dataTab || "statistics"));
|
||||
|
||||
// Remember the last opened tab so the sidebar entry can reopen it.
|
||||
// Watch the route metadata directly so leaving this workspace does not save
|
||||
// the Statistics fallback as the last opened tab.
|
||||
watch(
|
||||
activeTab,
|
||||
() => route.meta.dataTab,
|
||||
(value) => {
|
||||
const tab = tabs.value.find((item) => item.value === value);
|
||||
if (tab) localStorage.setItem("data_last_tab", tab.routeName);
|
||||
|
||||
Reference in New Issue
Block a user