From c4d3d99cd49aa65d602327abcc5f848d81d6da4e Mon Sep 17 00:00:00 2001 From: waza-ari Date: Thu, 28 Mar 2024 20:55:52 +0000 Subject: [PATCH] fix: pick first available view if currently configured view got deleted (#2235) Resolves #2232 Co-authored-by: Daniel Herrmann Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2235 Reviewed-by: konrad Co-authored-by: waza-ari Co-committed-by: waza-ari --- frontend/src/views/project/ProjectView.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/project/ProjectView.vue b/frontend/src/views/project/ProjectView.vue index 055cdecd9..3a18fdbdd 100644 --- a/frontend/src/views/project/ProjectView.vue +++ b/frontend/src/views/project/ProjectView.vue @@ -26,7 +26,7 @@ const currentView = computed(() => { }) function redirectToFirstViewIfNecessary() { - if (viewId === 0) { + if (viewId === 0 || !projectStore.projects[projectId]?.views.find(v => v.id === viewId)) { // Ideally, we would do that in the router redirect, but the projects (and therefore, the views) // are not always loaded then. const firstViewId = projectStore.projects[projectId]?.views[0].id