fix: button state in during closing

This commit is contained in:
2026-07-09 15:15:15 +08:00
parent 64b790e49f
commit 3d7bd6362f
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -241,7 +241,7 @@ async function handlePrimaryButtonClick() {
break;
case 'READY':
let locale = $('#locale').value;
let options = { locale, mapping: new Object(), writable: new Boolean(writable) };
let options = { locale, subcategories, mapping: new Object(), writable: new Boolean(writable), start: 2, limit: null };
for (let element of $.all("input[type='number'].params")) {
parameters[element.id] = element.disabled ? null : element.valueAsNumber;
@@ -264,9 +264,8 @@ async function handlePrimaryButtonClick() {
}
if (options.slice) {
options.start = $('#offset').valueAsNumber * $('#chunksize').valueAsNumber + 2;
options.limit = Math.min(minor || major, $('#chunksize').valueAsNumber);
options.subcategories = subcategories.length > 0 ? subcategories: null;
options.start += $('#offset').valueAsNumber * $('#chunksize').valueAsNumber;
}
await Rpc2.invoke('begin', options, parameters);
@@ -432,8 +431,8 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
$('#remainingLabel').innerText = '';
break;
case 'CLOSING':
try {
if (writable === null) break;
if (writable) try {
$.all('#actions > button').forEach(e => e.disabled = true);
let data = await filereader().then(([_, b]) => Rpc2.invoke('merge', new Uint8Array(b).toBase64()));
await writable.write(Uint8Array.fromBase64(data));
await writable.close();
@@ -443,6 +442,7 @@ while (await new Promise(o => setTimeout(o, 1000, true))) {
await writable.abort().catch(() => void 0);
}
writable = null;
continue;
case 'RUNNING':
$('#send > span.text').innerText = 'Pause';
$('#send').classList.add('pulse');