From c376556a9b2a287d88f160a99a5109f3b3adba25 Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 23 Dec 2022 01:19:04 +0100 Subject: [PATCH] refresh collections, fix #219 --- components/NavSearch.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/NavSearch.vue b/components/NavSearch.vue index 240647a1..05b9e292 100644 --- a/components/NavSearch.vue +++ b/components/NavSearch.vue @@ -13,6 +13,7 @@ import { mdiMagnify, mdiClose } from '@mdi/js' export default { data: () => ({ mdiMagnify, mdiClose, + oldRoute: '', collections: [] }), async fetch () { @@ -24,7 +25,12 @@ export default { return this.$route.name === 'index' }, showCollectionsBar () { - return ['index', 'collection-collection'].includes(this.$route.name) + const show = ['index', 'collection-collection'].includes(this.$route.name) + if (show && this.oldRoute !== this.$route.name) { + this.oldRoute = this.$route.name + this.$fetch() + } + return show }, ...mapState(['settings']) },