refresh collections, fix #219

This commit is contained in:
lesion
2022-12-23 01:19:04 +01:00
parent 064bf46df7
commit c376556a9b

View File

@@ -13,6 +13,7 @@ import { mdiMagnify, mdiClose } from '@mdi/js'
export default { export default {
data: () => ({ data: () => ({
mdiMagnify, mdiClose, mdiMagnify, mdiClose,
oldRoute: '',
collections: [] collections: []
}), }),
async fetch () { async fetch () {
@@ -24,7 +25,12 @@ export default {
return this.$route.name === 'index' return this.$route.name === 'index'
}, },
showCollectionsBar () { 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']) ...mapState(['settings'])
}, },