Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix change account sidebar display bad workspace

Smaug673957627a7a86d4
diff --git a/frontend/components/Sidebar/SidebarWorkspaces.vue b/frontend/components/Sidebar/SidebarWorkspaces.vue
index ce7ae710..c7003a4b 100644
--- a/frontend/components/Sidebar/SidebarWorkspaces.vue
+++ b/frontend/components/Sidebar/SidebarWorkspaces.vue
@@ -14,10 +14,13 @@
<script setup lang="ts">
import AppSelectOption from './SidebarWorkspace.vue';
import type { Workspace } from './helpers';
-const { workspaceId } = useSidebar();
-workspaceId.value = localStorage.getItem('filterWorkspace');
+const { workspaceId } = useSidebar();
+const storage_item = localStorage.getItem('filterWorkspace');
const props = defineProps<{ options: Workspace[] }>();
+
+if (storage_item && props.options.find(option => option.value == storage_item)) workspaceId.value = storage_item;
+
const isOpen = ref(false);
const selectedOption = computed(() => props.options.find(option => option.value == workspaceId.value) || props.options.find(option => !option.value));
const toggleDropdown = () => (isOpen.value = !isOpen.value);