fix: pick first available view if currently configured view got deleted
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Daniel Herrmann 2024-03-23 15:50:04 +01:00
parent ecd002dca3
commit 51d3a17c22
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