fix: pick first available view if currently configured view got deleted (#2235)
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Resolves #2232 Co-authored-by: Daniel Herrmann <daniel.herrmann1@gmail.com> Reviewed-on: #2235 Reviewed-by: konrad <k@knt.li> Co-authored-by: waza-ari <daniel.herrmann@makerspace-darmstadt.de> Co-committed-by: waza-ari <daniel.herrmann@makerspace-darmstadt.de>
This commit is contained in:
parent
30b4ed6b23
commit
c4d3d99cd4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user