Fix: 修复在线版python_pyodide板卡本地文件管理下文件编辑后无法保存

This commit is contained in:
王立帮
2024-12-22 10:05:11 +08:00
parent c2edffa8a3
commit 1bf7ec2e93
3 changed files with 10 additions and 5 deletions

View File

@@ -330,10 +330,13 @@ export default class StatusBarFileSystem extends PageBase {
this.#fileTree_.showProgress();
const id = this.#fileTree_.getSelectedNodeId();
const fs = this.#fileTree_.getFS();
const [error,] = await fs.writeFile(id, this.#editor_.getValue());
this.#fileTree_.hideProgress();
if (!error) {
try {
await fs.writeFile(id, this.#editor_.getValue());
this.setStatus(false);
} catch (error) {
Debug.error(error);
} finally {
this.#fileTree_.hideProgress();
}
}