From df64a91987fe4eb15484aaa229ed8d992a960b72 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Fri, 20 Dec 2024 09:26:48 +0100 Subject: [PATCH] kanban > virtual sample dialog : start with tab static if no dynamic files --- src/stores/virtualSample.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stores/virtualSample.js b/src/stores/virtualSample.js index 1837da0..9825632 100644 --- a/src/stores/virtualSample.js +++ b/src/stores/virtualSample.js @@ -3,13 +3,13 @@ import { ref, watch } from "vue"; import { usePageStore } from "./page"; export const useVirtualSampleStore = defineStore("virtual-sample", () => { - const activeTab = ref("dynamic"); - const currentFile = ref(null); - const isLoopAnimationEnabled = ref(false); - const { page } = usePageStore(); const step = page.steps.find((step) => step.id === "virtualSample"); + const activeTab = ref(step.files.dynamic ? "dynamic" : "static"); + const currentFile = ref(null); + const isLoopAnimationEnabled = ref(false); + watch(activeTab, () => (currentFile.value = null)); return { activeTab, currentFile, step, isLoopAnimationEnabled };