diff --git a/web/src/lib/components/ToolPage.svelte b/web/src/lib/components/ToolPage.svelte index f24e2e3..3fed503 100644 --- a/web/src/lib/components/ToolPage.svelte +++ b/web/src/lib/components/ToolPage.svelte @@ -33,17 +33,15 @@ if (isInfo) { status = 'loaded'; } else { - await apply(); + await runTool(); } } catch (e) { showError(e); } } - async function apply() { - if (!source || isInfo || status === 'processing') return; - errorText = ''; - status = 'processing'; + async function runTool() { + if (!source || isInfo) return; try { result = await tool.run(source, values); status = 'loaded'; @@ -52,6 +50,13 @@ } } + function apply() { + if (!source || isInfo || status === 'processing') return; + errorText = ''; + status = 'processing'; + runTool(); + } + function showError(e: unknown) { status = source ? 'loaded' : 'idle'; errorText = e instanceof Error ? e.message : String(e);