fix: handle non-200 responses in config update, ensure progress removal runs only on success
This commit is contained in:
@@ -235,9 +235,13 @@ export class Controller {
|
||||
method: "POST",
|
||||
body: json,
|
||||
})
|
||||
.then(response => response.text())
|
||||
.then(text => statusCallback(text))
|
||||
.then(_ => {
|
||||
.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 => {
|
||||
@@ -245,6 +249,7 @@ export class Controller {
|
||||
});
|
||||
});
|
||||
}, 250)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user