mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 13:36:36 +00:00
fix: resolve loading image error
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user