From 9955886ea19432209453e6dbf561b488b07509a5 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 27 Sep 2022 11:10:28 +0200 Subject: [PATCH] fix(nc-gui): initial right sidebar state open --- packages/nc-gui/composables/useSidebar/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/composables/useSidebar/index.ts b/packages/nc-gui/composables/useSidebar/index.ts index 56126edebd..1a38efe1f4 100644 --- a/packages/nc-gui/composables/useSidebar/index.ts +++ b/packages/nc-gui/composables/useSidebar/index.ts @@ -27,7 +27,9 @@ const createSidebar = (id: string, props: UseSidebarProps = {}) => { } if (props.useStorage) { - const storage = toRefs(useStorage(id, { isOpen, hasSidebar }, localStorage, { mergeDefaults: true }).value) + const storage = toRefs( + useStorage(id, { isOpen: isOpen.value, hasSidebar: hasSidebar.value }, localStorage, { mergeDefaults: true }).value, + ) isOpen.value = storage.isOpen.value hasSidebar.value = storage.hasSidebar.value @@ -61,7 +63,9 @@ const createSidebar = (id: string, props: UseSidebarProps = {}) => { const leftSidebar = createSharedComposable(() => createSidebar('leftSidebar')) -const rightSidebar = createSharedComposable(() => createSidebar('rightSidebar', { useStorage: true, isOpen: true })) +const rightSidebar = createSharedComposable(() => + createSidebar('rightSidebar', { useStorage: true, isOpen: true, hasSidebar: true }), +) export const useSidebar = (id: string, props: UseSidebarProps = {}) => { const sidebar = id.includes('left') ? leftSidebar() : rightSidebar()