fix: use async action to change current list
This commit is contained in:
parent
7f5f44d7f0
commit
a60ad77bdc
6 changed files with 8 additions and 8 deletions
|
@ -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}"
|
||||
>
|
||||
<span class="icon handle">
|
||||
<icon icon="grip-lines"/>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue