fix: handle non-200 responses in config update, ensure progress removal runs only on success

This commit is contained in:
2026-04-13 12:38:00 +02:00
parent 12405d1bef
commit 964bdb0454

View File

@@ -235,16 +235,21 @@ export class Controller {
method: "POST",
body: json,
})
.then(response => response.text())
.then(text => statusCallback(text))
.then(_ => {
controller.progressview.removeProgress("set_config");
setTimeout(() => {
controller.downloadConfig().then(r => {
controller.updateSaveList().then(r => {
.then(async response => {
let text = response.text();
statusCallback(await text)
return response.status
})
.then(status => {
if (status == 200) {
controller.progressview.removeProgress("set_config");
setTimeout(() => {
controller.downloadConfig().then(r => {
controller.updateSaveList().then(r => {
});
});
});
}, 250)
}, 250)
}
})
}