forked from vikunja/vikunja
Merge branch 'fix_redirecttofirstviewifnecessary' into feat_calendar
This commit is contained in:
commit
2390c7f4a8
|
@ -9,10 +9,10 @@
|
|||
|
||||
<div
|
||||
class="switch-view-container d-print-none"
|
||||
:class="{'is-justify-content-flex-end': views.length === 1}"
|
||||
:class="{'is-justify-content-flex-end': (views && views.length === 1)}"
|
||||
>
|
||||
<div
|
||||
v-if="views.length > 1"
|
||||
v-if="(views && views.length > 1)"
|
||||
class="switch-view"
|
||||
>
|
||||
<BaseButton
|
||||
|
|
|
@ -30,6 +30,9 @@ function redirectToFirstViewIfNecessary() {
|
|||
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.
|
||||
if(!projectStore.projects[projectId]?.views || projectStore.projects[projectId]?.views.length == 0) {
|
||||
return
|
||||
}
|
||||
const firstViewId = projectStore.projects[projectId]?.views[0].id
|
||||
if (firstViewId) {
|
||||
router.replace({
|
||||
|
|
Loading…
Reference in New Issue