chore: small review adjustments

This commit is contained in:
Dominik Pschenitschni 2022-10-03 12:35:15 +02:00
parent 367ad1e5a5
commit af7f8400e9
No known key found for this signature in database
GPG key ID: B257AC0149F43A77

View file

@ -6,7 +6,7 @@
'draggable': !(loadingInternal || loading), 'draggable': !(loadingInternal || loading),
'has-light-text': color !== TASK_DEFAULT_COLOR && !colorIsDark(color), 'has-light-text': color !== TASK_DEFAULT_COLOR && !colorIsDark(color),
}" }"
:style="{'background-color': color !== TASK_DEFAULT_COLOR ? color : false}" :style="{'background-color': color !== TASK_DEFAULT_COLOR ? color : undefined}"
@click.exact="openTaskDetail()" @click.exact="openTaskDetail()"
@click.ctrl="() => toggleTaskDone(task)" @click.ctrl="() => toggleTaskDone(task)"
@click.meta="() => toggleTaskDone(task)" @click.meta="() => toggleTaskDone(task)"
@ -44,11 +44,11 @@
<priority-label :priority="task.priority" :done="task.done"/> <priority-label :priority="task.priority" :done="task.done"/>
<div class="assignees" v-if="task.assignees.length > 0"> <div class="assignees" v-if="task.assignees.length > 0">
<user <user
v-for="u in task.assignees"
:avatar-size="24" :avatar-size="24"
:key="task.id + 'assignee' + u.id" :key="task.id + 'assignee' + u.id"
:show-username="false" :show-username="false"
:user="u" :user="u"
v-for="u in task.assignees"
/> />
</div> </div>
<checklist-summary :task="task"/> <checklist-summary :task="task"/>
@ -69,10 +69,10 @@
import {ref, computed} from 'vue' import {ref, computed} from 'vue'
import {useRouter} from 'vue-router' import {useRouter} from 'vue-router'
import PriorityLabel from '../../../components/tasks/partials/priorityLabel.vue' import PriorityLabel from '@/components/tasks/partials/priorityLabel.vue'
import User from '../../../components/misc/user.vue' import User from '@/components/misc/user.vue'
import Done from '@/components/misc/Done.vue' import Done from '@/components/misc/Done.vue'
import Labels from '../../../components/tasks/partials/labels.vue' import Labels from '@/components/tasks/partials/labels.vue'
import ChecklistSummary from './checklist-summary.vue' import ChecklistSummary from './checklist-summary.vue'
import {TASK_DEFAULT_COLOR, getHexColor} from '@/models/task' import {TASK_DEFAULT_COLOR, getHexColor} from '@/models/task'
@ -98,10 +98,9 @@ const color = computed(() => getHexColor(props.task.hexColor))
async function toggleTaskDone(task: ITask) { async function toggleTaskDone(task: ITask) {
loadingInternal.value = true loadingInternal.value = true
try { try {
const done = !task.done
await useTaskStore().update({ await useTaskStore().update({
...task, ...task,
done, done: !task.done,
}) })
} finally { } finally {
loadingInternal.value = false loadingInternal.value = false