1
0

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
No known key found for this signature in database
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( async function handleSetCurrentProject(
{project, forceUpdate = false}: {project: IProject | null, forceUpdate?: boolean}, {project, forceUpdate = false}: {project: IProject | null, forceUpdate?: boolean},
) { ) {
if (project === null) { if (project === null || typeof project === 'undefined') {
setCurrentProject({}) setCurrentProject({})
setBackground('') setBackground('')
setBlurHash('') setBlurHash('')

View File

@ -18,7 +18,7 @@
<router-link :to="{ name: 'project.index', params: { projectId: p.id } }"> <router-link :to="{ name: 'project.index', params: { projectId: p.id } }">
{{ getProjectTitle(p) }} {{ getProjectTitle(p) }}
</router-link> </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> </template>
</h6> </h6>
@ -539,7 +539,7 @@ const visible = ref(false)
const taskId = toRef(props, 'taskId') const taskId = toRef(props, 'taskId')
const project = computed(() => task.projectId ? projectStore.projects[task.projectId] : null) const project = computed(() => projectStore.projects[task.projectId])
watchEffect(() => { watchEffect(() => {
baseStore.handleSetCurrentProject({ baseStore.handleSetCurrentProject({
project: project.value, project: project.value,