fix: promise chaining

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