From 86eff7d49e95c3dcd714a76abc6c2dbc05e98ef6 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 4 Sep 2023 20:27:55 +0200 Subject: [PATCH] fix(task): don't reload the kanban board when opening a task --- src/views/tasks/TaskDetailView.vue | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index b4ddb0504..cfa2d4424 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -536,17 +536,19 @@ const taskColor = ref('') const visible = ref(false) const project = computed(() => projectStore.projects[task.value.projectId]) -watchEffect(() => { - if (typeof project.value === 'undefined') { - // assuming the task has not been loaded completely and thus the project id is 0. - // This avoids flickering between a project background and none when opening the task detail view from - // any the project views. - return - } - baseStore.handleSetCurrentProject({ - project: project.value, +watch( + () => task.value?.projectId, + () => { + if (typeof project.value === 'undefined') { + // assuming the task has not been loaded completely and thus the project id is 0. + // This avoids flickering between a project background and none when opening the + // task detail view from any of the project views. + return + } + baseStore.handleSetCurrentProject({ + project: project.value, + }) }) -}) const canWrite = computed(() => ( task.value.maxRight !== null &&