diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue index 1b3d54dc..16258985 100644 --- a/src/components/home/navigation.vue +++ b/src/components/home/navigation.vue @@ -117,7 +117,7 @@ @click="navigate" :href="href" class="list-menu-link" - :class="{'router-link-exact-active': isActive || currentList.id === l.id}" + :class="{'router-link-exact-active': isActive || currentList?.id === l.id}" > diff --git a/src/views/list/ShowList.vue b/src/views/list/ShowList.vue index 0877e700..68e417d9 100644 --- a/src/views/list/ShowList.vue +++ b/src/views/list/ShowList.vue @@ -139,7 +139,7 @@ export default { const list = new ListModel(listData) try { const loadedList = await this.listService.get(list) - this.$store.commit(CURRENT_LIST, loadedList) + await this.$store.dispatch(CURRENT_LIST, loadedList) this.setTitle(this.getListTitle(loadedList)) } finally { this.listLoaded = this.$route.params.listId diff --git a/src/views/list/settings/background.vue b/src/views/list/settings/background.vue index a6b5e01b..41e8b319 100644 --- a/src/views/list/settings/background.vue +++ b/src/views/list/settings/background.vue @@ -137,7 +137,7 @@ export default { } const list = await this.backgroundService.update({id: backgroundId, listId: this.$route.params.listId}) - this.$store.commit(CURRENT_LIST, list) + await this.$store.dispatch(CURRENT_LIST, list) this.$store.commit('namespaces/setListInNamespaceById', list) this.$message.success({message: this.$t('list.background.success')}) }, @@ -148,14 +148,14 @@ export default { } const list = await this.backgroundUploadService.create(this.$route.params.listId, this.$refs.backgroundUploadInput.files[0]) - this.$store.commit(CURRENT_LIST, list) + await this.$store.dispatch(CURRENT_LIST, list) this.$store.commit('namespaces/setListInNamespaceById', list) this.$message.success({message: this.$t('list.background.success')}) }, async removeBackground() { const list = await this.listService.removeBackground(this.currentList) - this.$store.commit(CURRENT_LIST, list) + await this.$store.dispatch(CURRENT_LIST, list) this.$store.commit('namespaces/setListInNamespaceById', list) this.$message.success({message: this.$t('list.background.removeSuccess')}) this.$router.back() diff --git a/src/views/list/settings/edit.vue b/src/views/list/settings/edit.vue index 8838cd09..55892519 100644 --- a/src/views/list/settings/edit.vue +++ b/src/views/list/settings/edit.vue @@ -103,7 +103,7 @@ export default { async save() { await this.$store.dispatch('lists/updateList', this.list) - this.$store.commit(CURRENT_LIST, this.list) + await this.$store.dispatch(CURRENT_LIST, this.list) this.setTitle(this.$t('list.edit.title', {list: this.list.title})) this.$message.success({message: this.$t('list.edit.success')}) this.$router.back() diff --git a/src/views/list/settings/share.vue b/src/views/list/settings/share.vue index 8820a266..4a9967f8 100644 --- a/src/views/list/settings/share.vue +++ b/src/views/list/settings/share.vue @@ -60,7 +60,7 @@ export default { const list = new ListModel({id: this.$route.params.listId}) this.list = await this.listService.get(list) - this.$store.commit(CURRENT_LIST, this.list) + await this.$store.dispatch(CURRENT_LIST, this.list) // This will trigger the dynamic loading of components once we actually have all the data to pass to them this.manageTeamsComponent = 'userTeam' this.manageUsersComponent = 'userTeam' diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index b7485fbd..4b88aae2 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -510,7 +510,7 @@ export default { }, parent: { handler(parent) { - this.$store.commit(CURRENT_LIST, parent !== null ? parent.list : this.currentList) + this.$store.dispatch(CURRENT_LIST, parent !== null ? parent.list : this.currentList) }, immediate: true, },