fix(core): 修复micropython 板卡文件管理 下载文件时的异常未被捕获

This commit is contained in:
王立帮
2025-08-21 21:48:05 +08:00
parent 30f3da24b1
commit 8d7d0d1917

View File

@@ -253,8 +253,9 @@ class StatusBarAmpy extends PageBase {
isHtmlName: true, isHtmlName: true,
name: Menu.getItem(Msg.Lang['statusbar.ampy.download'], ''), name: Menu.getItem(Msg.Lang['statusbar.ampy.download'], ''),
callback: async (_, { $trigger }) => { callback: async (_, { $trigger }) => {
const filePath = $trigger.attr('id');
this.#fileTree_.showProgress(); this.#fileTree_.showProgress();
try {
const filePath = $trigger.attr('id');
const fp = await window.showSaveFilePicker({ const fp = await window.showSaveFilePicker({
suggestedName: path.basename(filePath) suggestedName: path.basename(filePath)
}); });
@@ -271,6 +272,7 @@ class StatusBarAmpy extends PageBase {
await writer.write(result); await writer.write(result);
await writer.close(); await writer.close();
} }
} catch (_) { }
this.#fileTree_.hideProgress(); this.#fileTree_.hideProgress();
} }
} }