From b40d6f783c013c0d15bcfec656942947393be4fc Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 25 Apr 2022 19:59:02 +0200 Subject: [PATCH] fix: actually deleting the list now works --- src/views/list/settings/delete.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/views/list/settings/delete.vue b/src/views/list/settings/delete.vue index 52c4cefa..923aaa78 100644 --- a/src/views/list/settings/delete.vue +++ b/src/views/list/settings/delete.vue @@ -12,7 +12,9 @@

- {{ totalTasks > 0 ? $t('list.delete.tasksToDelete', {count: totalTasks}) : $t('list.delete.noTasksToDelete') }} + {{ + totalTasks > 0 ? $t('list.delete.tasksToDelete', {count: totalTasks}) : $t('list.delete.noTasksToDelete') + }}

@@ -45,6 +47,10 @@ const list = computed(() => store.getters['lists/getListById'](route.params.list watchEffect( () => { + if (!route.params.lisId) { + return + } + const taskCollectionService = new TaskCollectionService() taskCollectionService.getAll({listId: route.params.listId}).then(() => { totalTasks.value = taskCollectionService.totalPages * taskCollectionService.resultCount @@ -52,10 +58,10 @@ watchEffect( }, ) -useTitle(() => t('list.delete.title', {list: list.value.title})) +useTitle(() => t('list.delete.title', {list: list?.value?.title})) async function deleteList() { - await store.dispatch('lists/deleteList', list) + await store.dispatch('lists/deleteList', list.value) success({message: t('list.delete.success')}) router.push({name: 'home'}) }