fix(project): do not crash when views were not loaded yet
The project view crashed when accessing a task from /projects because the currentProject in store was not set, hence the views weren't set either. This change adds a fallback to it. Related to https://kolaente.dev/vikunja/vikunja/issues/2246 Related to https://community.vikunja.io/t/vikunja-freezes/2246/5
This commit is contained in:
parent
73bf119409
commit
9eb19e0362
@ -88,7 +88,7 @@ const currentProject = computed<IProject>(() => {
|
|||||||
})
|
})
|
||||||
useTitle(() => currentProject.value?.id ? getProjectTitle(currentProject.value) : '')
|
useTitle(() => currentProject.value?.id ? getProjectTitle(currentProject.value) : '')
|
||||||
|
|
||||||
const views = computed(() => currentProject.value?.views)
|
const views = computed(() => currentProject.value?.views || [])
|
||||||
|
|
||||||
// watchEffect would be called every time the prop would get a value assigned, even if that value was the same as before.
|
// watchEffect would be called every time the prop would get a value assigned, even if that value was the same as before.
|
||||||
// This resulted in loading and setting the project multiple times, even when navigating away from it.
|
// This resulted in loading and setting the project multiple times, even when navigating away from it.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user