@@ -67,7 +67,8 @@ a-layout.new-layout
6767 const { s, q, escape } = useMagicKeys ()
6868 const activeElement = useActiveElement ()
6969 const appStore = useAppStore ()
70- const { hideSidebar, databaseList } = storeToRefs (useAppStore ())
70+ const { hideSidebar, databaseList, database } = storeToRefs (useAppStore ())
71+ const originalDatabase = ref <string | undefined >(undefined )
7172 const { logs } = storeToRefs (useLogStore ())
7273 const { activeTab, footer } = storeToRefs (useIngestStore ())
7374 const { dataStatusMap } = storeToRefs (useUserStore ())
@@ -161,6 +162,7 @@ a-layout.new-layout
161162 })
162163
163164 onActivated (async () => {
165+ originalDatabase .value = database .value
164166 await appStore .refreshDatabaseList ()
165167 const tourStatus = useStorage (' tourStatus' , { navbar: false })
166168 if (! tourStatus .value .navbar ) {
@@ -170,6 +172,11 @@ a-layout.new-layout
170172 }
171173 })
172174
175+ onDeactivated (() => {
176+ database .value = originalDatabase .value
177+ originalDatabase .value = undefined
178+ })
179+
173180 // TODO: add more code type in the future if needed
174181 </script >
175182
0 commit comments