refresh collections, fix #219

This commit is contained in:
lesion 2022-12-23 01:19:04 +01:00
parent 064bf46df7
commit c376556a9b
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -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'])
},