Skip to content

Commit 212917f

Browse files
committed
Fix logic conditions loading to handle MSP errors
Add error callback to MSP.send_message in processNextCondition() so that if an individual logic condition fetch fails, loading continues with the next condition rather than halting indefinitely. Previously, only a success callback was provided, meaning any MSP error would stop the loading sequence without ever calling the final callback.
1 parent 6cce81e commit 212917f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

js/msp/MSPHelper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,10 +2495,12 @@ var mspHelper = (function () {
24952495

24962496
if (isConfigured) {
24972497
// Fetch from firmware - handler will put() it
2498-
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, function() {
2498+
// Use same callback for success and error to ensure loading continues
2499+
const onComplete = function() {
24992500
idx++;
25002501
processNextCondition();
2501-
});
2502+
};
2503+
MSP.send_message(MSPCodes.MSP2_INAV_LOGIC_CONDITIONS_SINGLE, [idx], false, onComplete, onComplete);
25022504
return; // Wait for async MSP response
25032505
} else {
25042506
// Not configured - put default directly and continue loop

0 commit comments

Comments
 (0)