1
0

chore(views): use view id instead of passing whole view object

This commit is contained in:
kolaente
2024-03-16 15:00:00 +01:00
parent 7368a51f18
commit 4c1a53beed
8 changed files with 31 additions and 31 deletions

View File

@ -12,7 +12,7 @@
<BaseButton
v-for="v in views"
class="switch-view-button"
:class="{'is-active': v.id === view.id}"
:class="{'is-active': v.id === viewId}"
:to="{ name: 'project.view', params: { projectId, viewId: v.id } }"
>
{{ getViewTitle(v) }}
@ -57,10 +57,10 @@ import {useI18n} from 'vue-i18n'
const {
projectId,
view,
viewId,
} = defineProps<{
projectId: number,
view: IProjectView,
projectId: IProject['id'],
viewId: IProjectView['id'],
}>()
const route = useRoute()
@ -109,7 +109,7 @@ watch(
return
}
console.debug(`Loading project, props.view = ${view}, $route.params =`, route.params, `, loadedProjectId = ${loadedProjectId.value}, currentProject = `, currentProject.value)
console.debug(`Loading project, $route.params =`, route.params, `, loadedProjectId = ${loadedProjectId.value}, currentProject = `, currentProject.value)
// Set the current project to the one we're about to load so that the title is already shown at the top
loadedProjectId.value = 0