fix: resolve loading image error

This commit is contained in:
2026-08-22 10:37:37 +05:00
parent 08038ede0d
commit 4b7086693c
+10 -5
View File
@@ -33,17 +33,15 @@
if (isInfo) { if (isInfo) {
status = 'loaded'; status = 'loaded';
} else { } else {
await apply(); await runTool();
} }
} catch (e) { } catch (e) {
showError(e); showError(e);
} }
} }
async function apply() { async function runTool() {
if (!source || isInfo || status === 'processing') return; if (!source || isInfo) return;
errorText = '';
status = 'processing';
try { try {
result = await tool.run(source, values); result = await tool.run(source, values);
status = 'loaded'; status = 'loaded';
@@ -52,6 +50,13 @@
} }
} }
function apply() {
if (!source || isInfo || status === 'processing') return;
errorText = '';
status = 'processing';
runTool();
}
function showError(e: unknown) { function showError(e: unknown) {
status = source ? 'loaded' : 'idle'; status = source ? 'loaded' : 'idle';
errorText = e instanceof Error ? e.message : String(e); errorText = e instanceof Error ? e.message : String(e);