Skip to content

Commit 9b8da64

Browse files
CopilotnerdCopter
andauthored
Fix failsafe bug: Show return altitude field for fixed altitude mode on first load (#4629)
* Initial plan * Fix failsafe bug: Show return altitude field for fixed altitude mode on first load Co-authored-by: nerdCopter <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: nerdCopter <[email protected]>
1 parent c5e676f commit 9b8da64

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/js/tabs/failsafe.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ failsafe.initialize = function (callback) {
323323
altitude_number_field.hide();
324324
}
325325
}
326-
showReturnAlt();
327326
$("#failsafeGpsRescueItemAltitudeSelect").on("change", showReturnAlt);
328327

329328
// Introduced in 1.43
@@ -332,6 +331,9 @@ failsafe.initialize = function (callback) {
332331
$('input[name="gps_rescue_allow_arming_without_fix"]').prop("checked", FC.GPS_RESCUE.allowArmingWithoutFix > 0);
333332
$('select[name="gps_rescue_altitude_mode"]').val(FC.GPS_RESCUE.altitudeMode);
334333

334+
// Call showReturnAlt after the altitude mode value is set
335+
showReturnAlt();
336+
335337
// Introduced in 1.44
336338
$('input[name="gps_rescue_min_start_dist"]').val(FC.GPS_RESCUE.minStartDistM);
337339

0 commit comments

Comments
 (0)