fix(subscription): make sure list subscription state is propagated everywhere for the current list
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2022-10-24 19:01:01 +02:00
parent f17bbeddec
commit 22a18f8437
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import type {MaybeRef} from '@vueuse/core'
import ListModel from '@/models/list'
import {success} from '@/message'
import {useBaseStore} from '@/stores/base'
const {add, remove, search, update} = createNewIndexer('lists', ['title', 'description'])
@ -64,6 +65,11 @@ export const useListStore = defineStore('list', {
setList(list: IList) {
this.lists[list.id] = list
update(list)
const baseStore = useBaseStore()
if (baseStore.currentList?.id === list.id) {
baseStore.setCurrentList(list)
}
},
setLists(lists: IList[]) {