fix(project): correctly load background when switching from or to a project view
continuous-integration/drone/push Build is passing Details

Resolves https://community.vikunja.io/t/background-does-not-load/1437
This commit is contained in:
kolaente 2023-06-20 10:54:13 +02:00
parent 464cc0ed8c
commit c27661107f
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 6 additions and 2 deletions

View File

@ -136,8 +136,6 @@ watch(
loadedProjectId.value = 0
const projectFromStore = projectStore.projects[projectData.id]
if (projectFromStore) {
baseStore.setBackground(null)
baseStore.setBlurHash(null)
baseStore.handleSetCurrentProject({project: projectFromStore})
}

View File

@ -539,6 +539,12 @@ const taskId = toRef(props, 'taskId')
const project = computed(() => projectStore.projects[task.value.projectId])
watchEffect(() => {
if (typeof project.value === 'undefined') {
// assuming the task has not been loaded completely and thus the project id is 0.
// This avoids flickering between a project background and none when opening the task detail view from
// any the project views.
return
}
baseStore.handleSetCurrentProject({
project: project.value,
})