1
0

Fix quick actions not working when nonexisting lists where left over in history

This commit is contained in:
kolaente
2021-07-20 18:03:38 +02:00
parent 176c6462bb
commit d81b4117f5
6 changed files with 60 additions and 17 deletions

View File

@ -91,7 +91,7 @@ export default {
const history = getHistory()
return history.map(l => {
return this.$store.getters['lists/getListById'](l.id)
})
}).filter(l => l !== null)
},
...mapState({
migratorsEnabled: state =>

View File

@ -12,17 +12,9 @@
</template>
<script>
import ListService from '@/services/list'
export default {
name: 'list-setting-delete',
data() {
return {
listService: ListService,
}
},
created() {
this.listService = new ListService()
const list = this.$store.getters['lists/getListById'](this.$route.params.listId)
this.setTitle(this.$t('list.delete.title', {list: list.title}))
},
@ -30,9 +22,8 @@ export default {
deleteList() {
const list = this.$store.getters['lists/getListById'](this.$route.params.listId)
this.listService.delete(list)
this.$store.dispatch('lists/deleteList', list)
.then(() => {
this.$store.commit('namespaces/removeListFromNamespaceById', list)
this.success({message: this.$t('list.delete.success')})
this.$router.push({name: 'home'})
})