(task) display step examples only for the first time

This commit is contained in:
Julien Calixte
2023-08-26 11:37:41 +02:00
parent 909eba1f27
commit 8abe0e8caa

View File

@@ -13,6 +13,7 @@ const store = useTaskStore()
const router = useRouter() const router = useRouter()
const props = defineProps<{ id: string; initialTask?: Taskable }>() const props = defineProps<{ id: string; initialTask?: Taskable }>()
const id = computed(() => props.id) const id = computed(() => props.id)
const hasTasks = computed(() => store.tasks.length > 0)
const exampleSteps: Stepable[] = [ const exampleSteps: Stepable[] = [
{ {
@@ -47,7 +48,9 @@ const exampleSteps: Stepable[] = [
} }
] ]
const steps = ref<Stepable[]>(props.initialTask?.steps ?? exampleSteps) const steps = ref<Stepable[]>(
props.initialTask?.steps ?? hasTasks.value ? [] : exampleSteps
)
const title = ref(props.initialTask?.title ?? '') const title = ref(props.initialTask?.title ?? '')
const link = ref(props.initialTask?.link ?? '') const link = ref(props.initialTask?.link ?? '')