From 32db7ae505c66807ff3100c4529576cd3f24b314 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Wed, 11 Nov 2020 11:41:54 -0500 Subject: [PATCH] Persist collections nav group state Fixes #929 --- app/src/components/v-detail/v-detail.vue | 5 +++-- .../collections/components/navigation.vue | 21 +++++++++++++++---- .../collections/composables/use-navigation.ts | 8 +++++-- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/src/components/v-detail/v-detail.vue b/app/src/components/v-detail/v-detail.vue index 3ced9238e8..120b028297 100644 --- a/app/src/components/v-detail/v-detail.vue +++ b/app/src/components/v-detail/v-detail.vue @@ -14,7 +14,7 @@ diff --git a/app/src/modules/collections/composables/use-navigation.ts b/app/src/modules/collections/composables/use-navigation.ts index d0f14f048f..3724464c6b 100644 --- a/app/src/modules/collections/composables/use-navigation.ts +++ b/app/src/modules/collections/composables/use-navigation.ts @@ -1,4 +1,4 @@ -import { computed } from '@vue/composition-api'; +import { computed, Ref, ref } from '@vue/composition-api'; import { useCollectionsStore, useUserStore } from '@/stores/'; import { Collection } from '@/types'; @@ -18,7 +18,11 @@ export type NavItemGroup = { items: NavItem[]; }; +let activeGroups: Ref; + export default function useNavigation() { + if (!activeGroups) activeGroups = ref([]); + const collectionsStore = useCollectionsStore(); const userStore = useUserStore(); @@ -72,5 +76,5 @@ export default function useNavigation() { }); }); - return { customNavItems, navItems }; + return { customNavItems, navItems, activeGroups }; }