From e5f631af8d81d9f54075ebe643bcd902635bff22 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 10 Nov 2022 16:44:16 +0100 Subject: [PATCH] fix(tasks): show any errors happening during task load --- src/composables/useTaskList.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/composables/useTaskList.ts b/src/composables/useTaskList.ts index 5f0dc06a1..334bea0cc 100644 --- a/src/composables/useTaskList.ts +++ b/src/composables/useTaskList.ts @@ -3,6 +3,7 @@ import {useRoute} from 'vue-router' import TaskCollectionService from '@/services/taskCollection' import type {ITask} from '@/modelTypes/ITask' +import {error} from '@/message' // FIXME: merge with DEFAULT_PARAMS in filters.vue export const getDefaultParams = () => ({ @@ -76,7 +77,11 @@ export function useTaskList(listId, sortByDefault = SORT_BY_DEFAULT) { const tasks = ref([]) async function loadTasks() { tasks.value = [] - tasks.value = await taskCollectionService.getAll(...getAllTasksParams.value) + try { + tasks.value = await taskCollectionService.getAll(...getAllTasksParams.value) + } catch (e) { + error(e) + } return tasks.value }