fix: set correct filename in openFile API, closes #803 (#810)

This commit is contained in:
Huang Xin
2025-04-04 19:20:02 +08:00
parent ab22a83332
commit 4703eec045
2 changed files with 4 additions and 4 deletions
@@ -54,12 +54,12 @@ const indexedDBFileSystem: FileSystem = {
return path;
}
},
async openFile(path: string, base: BaseDir) {
async openFile(path: string, base: BaseDir, filename?: string) {
if (isValidURL(path)) {
return await new RemoteFile(path).open();
return await new RemoteFile(path, filename).open();
} else {
const content = await this.readFile(path, base, 'binary');
return new File([content], path);
return new File([content], filename || path);
}
},
async copyFile(srcPath: string, dstPath: string, base: BaseDir) {