From 964bdb04548a3c6fd39fc927d4a29cd489076ebc Mon Sep 17 00:00:00 2001 From: Empire Date: Mon, 13 Apr 2026 12:38:00 +0200 Subject: [PATCH] fix: handle non-200 responses in config update, ensure progress removal runs only on success --- .../MainBoard/rust/src_webpack/src/main.ts | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Software/MainBoard/rust/src_webpack/src/main.ts b/Software/MainBoard/rust/src_webpack/src/main.ts index 7af0067..bb8ad59 100644 --- a/Software/MainBoard/rust/src_webpack/src/main.ts +++ b/Software/MainBoard/rust/src_webpack/src/main.ts @@ -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) + } }) }