fix(project): correctly load background when switching from or to a project view
Resolves https://community.vikunja.io/t/background-does-not-load/1437
This commit is contained in:
parent
464cc0ed8c
commit
c27661107f
@ -136,8 +136,6 @@ watch(
|
|||||||
loadedProjectId.value = 0
|
loadedProjectId.value = 0
|
||||||
const projectFromStore = projectStore.projects[projectData.id]
|
const projectFromStore = projectStore.projects[projectData.id]
|
||||||
if (projectFromStore) {
|
if (projectFromStore) {
|
||||||
baseStore.setBackground(null)
|
|
||||||
baseStore.setBlurHash(null)
|
|
||||||
baseStore.handleSetCurrentProject({project: projectFromStore})
|
baseStore.handleSetCurrentProject({project: projectFromStore})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,6 +539,12 @@ const taskId = toRef(props, 'taskId')
|
|||||||
|
|
||||||
const project = computed(() => projectStore.projects[task.value.projectId])
|
const project = computed(() => projectStore.projects[task.value.projectId])
|
||||||
watchEffect(() => {
|
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({
|
baseStore.handleSetCurrentProject({
|
||||||
project: project.value,
|
project: project.value,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user