fix: make computed side-effect free
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
This commit is contained in:
parent
b9c18b8f8b
commit
0d0b3c0ca7
|
@ -447,7 +447,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<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 {useRouter, type RouteLocation} from 'vue-router'
|
||||||
import {useI18n} from 'vue-i18n'
|
import {useI18n} from 'vue-i18n'
|
||||||
import {unrefElement} from '@vueuse/core'
|
import {unrefElement} from '@vueuse/core'
|
||||||
|
@ -536,16 +536,11 @@ const visible = ref(false)
|
||||||
|
|
||||||
const taskId = toRef(props, 'taskId')
|
const taskId = toRef(props, 'taskId')
|
||||||
|
|
||||||
const project = computed(() => {
|
const project = computed(() => task.projectId ? projectStore.getProjectById(task.projectId) : null)
|
||||||
if (!task.projectId) {
|
watchEffect(() => {
|
||||||
return {
|
baseStore.handleSetCurrentProject({
|
||||||
project: null,
|
project: project.value,
|
||||||
}
|
})
|
||||||
}
|
|
||||||
|
|
||||||
const project = projectStore.getProjectById(task.projectId)
|
|
||||||
baseStore.handleSetCurrentProject({project})
|
|
||||||
return project
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const canWrite = computed(() => (
|
const canWrite = computed(() => (
|
||||||
|
|
Reference in New Issue
Block a user