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) {
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);