fix: pick first available view if currently configured view got deleted #2235

Merged
konrad merged 1 commits from waza-ari/vikunja:2232-pick-first-available-view-if-view-deleted into main 2024-03-28 20:56:03 +00:00
1 changed files with 1 additions and 1 deletions

View File

@ -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