fix(subscription): make sure list subscription state is propagated everywhere for the current list
This commit is contained in:
parent
f17bbeddec
commit
22a18f8437
@ -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[]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user