fix: handle non-200 responses in config update, ensure progress removal runs only on success
This commit is contained in:
@@ -235,16 +235,21 @@ export class Controller {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
body: json,
|
body: json,
|
||||||
})
|
})
|
||||||
.then(response => response.text())
|
.then(async response => {
|
||||||
.then(text => statusCallback(text))
|
let text = response.text();
|
||||||
.then(_ => {
|
statusCallback(await text)
|
||||||
controller.progressview.removeProgress("set_config");
|
return response.status
|
||||||
setTimeout(() => {
|
})
|
||||||
controller.downloadConfig().then(r => {
|
.then(status => {
|
||||||
controller.updateSaveList().then(r => {
|
if (status == 200) {
|
||||||
|
controller.progressview.removeProgress("set_config");
|
||||||
|
setTimeout(() => {
|
||||||
|
controller.downloadConfig().then(r => {
|
||||||
|
controller.updateSaveList().then(r => {
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}, 250)
|
||||||
}, 250)
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user