From 8abe0e8caadf9d78d79dc43164f958411cb63390 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 26 Aug 2023 11:37:41 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(task)=20display=20step=20examples?= =?UTF-8?q?=20only=20for=20the=20first=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/task/components/TaskForm.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/task/components/TaskForm.vue b/src/modules/task/components/TaskForm.vue index 828878b..794871b 100644 --- a/src/modules/task/components/TaskForm.vue +++ b/src/modules/task/components/TaskForm.vue @@ -13,6 +13,7 @@ const store = useTaskStore() const router = useRouter() const props = defineProps<{ id: string; initialTask?: Taskable }>() const id = computed(() => props.id) +const hasTasks = computed(() => store.tasks.length > 0) const exampleSteps: Stepable[] = [ { @@ -47,7 +48,9 @@ const exampleSteps: Stepable[] = [ } ] -const steps = ref(props.initialTask?.steps ?? exampleSteps) +const steps = ref( + props.initialTask?.steps ?? hasTasks.value ? [] : exampleSteps +) const title = ref(props.initialTask?.title ?? '') const link = ref(props.initialTask?.link ?? '')