From e28f0f5be439ce2cfaed7e527268189f80a6646d Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Wed, 5 Jan 2022 13:14:50 +0000 Subject: [PATCH] chore(addTask) improve order (#1297) Co-authored-by: Dominik Pschenitschni Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/1297 Reviewed-by: konrad Co-authored-by: Dominik Pschenitschni Co-committed-by: Dominik Pschenitschni --- src/components/tasks/add-task.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/tasks/add-task.vue b/src/components/tasks/add-task.vue index e7d44d30..0ddc6155 100644 --- a/src/components/tasks/add-task.vue +++ b/src/components/tasks/add-task.vue @@ -42,7 +42,7 @@ import {useI18n} from 'vue-i18n' import {useStore} from 'vuex' import { tryOnMounted, debouncedWatch, useWindowSize, MaybeRef } from '@vueuse/core' -import TaskService from '../../services/task' +import TaskService from '@/services/task' import QuickAddMagic from '@/components/tasks/partials/quick-add-magic.vue' function cleanupTitle(title: string) { @@ -117,9 +117,6 @@ function useAutoHeightTextarea(value: MaybeRef) { return textarea } -const emit = defineEmits(['taskAdded']) - - const props = defineProps({ defaultPosition: { type: Number, @@ -127,8 +124,7 @@ const props = defineProps({ }, }) -const taskService = shallowReactive(new TaskService()) -const errorMessage = ref('') +const emit = defineEmits(['taskAdded']) const newTaskTitle = ref('') const newTaskInput = useAutoHeightTextarea(newTaskTitle) @@ -136,6 +132,9 @@ const newTaskInput = useAutoHeightTextarea(newTaskTitle) const { t } = useI18n() const store = useStore() +const taskService = shallowReactive(new TaskService()) +const errorMessage = ref('') + async function addTask() { if (newTaskTitle.value === '') { errorMessage.value = t('list.create.addTitleRequired')