chore: don't set the current project to null if it's undefined already

This commit is contained in:
kolaente 2023-04-12 12:31:22 +02:00
parent b69a05689b
commit e4d97e0520
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ export const useBaseStore = defineStore('base', () => {
async function handleSetCurrentProject(
{project, forceUpdate = false}: {project: IProject | null, forceUpdate?: boolean},
) {
if (project === null) {
if (project === null || typeof project === 'undefined') {
setCurrentProject({})
setBackground('')
setBlurHash('')

View File

@ -18,7 +18,7 @@
<router-link :to="{ name: 'project.index', params: { projectId: p.id } }">
{{ getProjectTitle(p) }}
</router-link>
<span class="has-text-grey-light" v-if="p.id !== project.id"> &gt; </span>
<span class="has-text-grey-light" v-if="p.id !== project?.id"> &gt; </span>
</template>
</h6>
@ -539,7 +539,7 @@ const visible = ref(false)
const taskId = toRef(props, 'taskId')
const project = computed(() => task.projectId ? projectStore.projects[task.projectId] : null)
const project = computed(() => projectStore.projects[task.projectId])
watchEffect(() => {
baseStore.handleSetCurrentProject({
project: project.value,