fix: promise chaining

This commit is contained in:
2026-08-12 16:39:53 +08:00
parent eb5c49442a
commit 314f1add79
+1 -2
View File
@@ -426,8 +426,7 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
if (save) try {
$.all('#actions > button').forEach(e => e.disabled = true);
var writable = await filehandle.createWritable({ mode: 'exclusive' });
let buffer = await filehandle.getFile().then(f => f.arrayBuffer());
let data = await Rpc2.invoke('merge', { params: [new Uint8Array(buffer).toBase64()] });
let data = await filehandle.getFile().then(f => Rpc2.invoke('merge', { params: [new Uint8Array(f.arrayBuffer()).toBase64()] }));
await writable.write(Uint8Array.fromBase64(data));
await writable.close();
await Rpc2.notify('close');