fix: make computed side-effect free
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2023-03-28 21:31:38 +02:00
parent b9c18b8f8b
commit 0d0b3c0ca7
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 11 deletions

View File

@ -447,7 +447,7 @@
</template>
<script lang="ts" setup>
import {ref, reactive, toRef, shallowReactive, computed, watch, nextTick, type PropType} from 'vue'
import {ref, reactive, toRef, shallowReactive, computed, watch, watchEffect, nextTick, type PropType} from 'vue'
import {useRouter, type RouteLocation} from 'vue-router'
import {useI18n} from 'vue-i18n'
import {unrefElement} from '@vueuse/core'
@ -536,16 +536,11 @@ const visible = ref(false)
const taskId = toRef(props, 'taskId')
const project = computed(() => {
if (!task.projectId) {
return {
project: null,
}
}
const project = projectStore.getProjectById(task.projectId)
baseStore.handleSetCurrentProject({project})
return project
const project = computed(() => task.projectId ? projectStore.getProjectById(task.projectId) : null)
watchEffect(() => {
baseStore.handleSetCurrentProject({
project: project.value,
})
})
const canWrite = computed(() => (