From 219e0c2ced4bb66538719a62d400e2268405f46c Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 10 Aug 2023 00:17:19 +0200 Subject: [PATCH] fix: make path changeable even if linked to summary --- .../src/lib/components/ScriptBuilder.svelte | 23 ++++++++++--------- .../flows/content/FlowSettings.svelte | 22 +++++++++--------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/frontend/src/lib/components/ScriptBuilder.svelte b/frontend/src/lib/components/ScriptBuilder.svelte index 50547df6a7..5571673445 100644 --- a/frontend/src/lib/components/ScriptBuilder.svelte +++ b/frontend/src/lib/components/ScriptBuilder.svelte @@ -264,17 +264,6 @@ } let path: Path | undefined = undefined - $: { - if (initialPath == '' && script.summary?.length > 0) { - path?.setName( - script.summary - .toLowerCase() - .replace(/[^a-z0-9_]/g, '_') - .replace(/-+/g, '_') - .replace(/^-|-$/g, '') - ) - } - } @@ -289,6 +278,18 @@ autofocus bind:value={script.summary} placeholder="Short summary to be displayed when listed" + on:keydown={() => { + if (initialPath == '' && script.summary?.length > 0) { + console.log('FOO') + path?.setName( + script.summary + .toLowerCase() + .replace(/[^a-z0-9_]/g, '_') + .replace(/-+/g, '_') + .replace(/^-|-$/g, '') + ) + } + }} />

Path

0) { - path?.setName( - $flowStore.summary - .toLowerCase() - .replace(/[^a-z0-9_]/g, '_') - .replace(/-+/g, '_') - .replace(/^-|-$/g, '') - ) - } - }
@@ -75,6 +64,17 @@ bind:value={$flowStore.summary} placeholder="Short summary to be displayed when listed" id="flow-summary" + on:keydown={() => { + if (initialPath == '' && $flowStore.summary?.length > 0) { + path?.setName( + $flowStore.summary + .toLowerCase() + .replace(/[^a-z0-9_]/g, '_') + .replace(/-+/g, '_') + .replace(/^-|-$/g, '') + ) + } + }} />