diff --git a/frontend/wizard-vue/src/pages/WizardPage.vue b/frontend/wizard-vue/src/pages/WizardPage.vue index 54b5572..2092c14 100644 --- a/frontend/wizard-vue/src/pages/WizardPage.vue +++ b/frontend/wizard-vue/src/pages/WizardPage.vue @@ -6,9 +6,9 @@ import Copyable from "@/components/Copyable.vue"; import EditUrlModal from "@/components/EditUrlModal.vue"; import {decodeUrl, encodeUrl, getScreenshotUrl} from "@/urlmaker"; import {useWizardStore} from "@/stores/wizard.ts"; +import {debounce} from "es-toolkit"; const store = useWizardStore(); - const existingLink = ref(""); const link = ref(""); const editModalVisible = ref(false); @@ -25,6 +25,14 @@ watch(existingLink, async (value) => { } }); +watch(store.specs, debounce(() => { + if(store.formValid) { + generateLink(); + } else { + link.value = ""; + } +}, 100)); + async function generateLink() { try { link.value = await encodeUrl(store.specs); @@ -43,7 +51,7 @@ function screenshot() {