Skip to content

Commit 35d0d0d

Browse files
committed
more call of categories when initialize
1 parent f561436 commit 35d0d0d

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

src/js/tabs/auxiliary.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,32 @@ const buildMap = [
1818
{ buildKey: 'cam', buildOption: ['USE_CAMERA_CONTROL']},
1919
{ buildKey: 'div', buildOption: ['USE_ARCO_TRAINER', 'USE_DASHBOARD', 'USE_PINIO']},
2020
{ buildKey: 'dshot', buildOption: ['USE_DSHOT']},
21-
{ buildKey: 'gps', buildOption: ['USE_GPS', 'USE_GPS_PLUS_CODES']},
21+
{ buildKey: 'gps_mag', buildOption: ['USE_GPS', 'USE_GPS_PLUS_CODES', 'USE_MAG']},
2222
{ buildKey: 'led_strip', buildOption: ['USE_LED_STRIP', 'USE_LED_STRIP_64']},
23-
{ buildKey: 'mag', buildOption: ['USE_MAG']},
2423
{ buildKey: 'osd', buildOption: ['USE_OSD', 'USE_OSD_SD', 'USE_OSD_HD', 'USE_FRSKYOSD']},
2524
{ buildKey: 'serial', buildOption: ['USE_SERIALRX', 'USE_SERIALRX_FPORT']},
2625
{ buildKey: 'servos', buildOption: ['USE_SERVOS']},
2726
{ buildKey: 'telemetry', buildOption: ['USE_TELEMETRY', 'USE_TELEMETRY_SMARTPORT']},
2827
{ buildKey: 'vtx', buildOption: ['USE_VTX']},
2928
];
3029

31-
const flightModes = ["ARM","ANGLE","HORIZON","ANTI GRAVITY","MAG","HEADFREE","HEADADJ","SERVO1","SERVO2","SERVO3",
32-
"FAILSAFE","AIR MODE","FPV ANGLE MIX","FLIP OVER AFTER CRASH","USER1","USER2","USER3","USER4","ACRO TRAINER","LAUNCH CONTROL"];
30+
const flightControl = ['ARM', 'ANGLE', 'HORIZON', 'ANTI GRAVITY', 'HEADFREE', 'HEADADJ', 'FAILSAFE', 'AIR MODE', 'FPV ANGLE MIX', 'ACRO TRAINER', 'LAUNCH CONTROL'];
3331

3432
// Categories to be mapped with buildMap. Category 'all' are virtuel and always included
3533
const categoryTable = [
36-
{ name: '3D', buildKey: ['dshot'], modes: ['3D', '3D DISABLE / SWITCH']},
37-
{ name: 'BEEP', buildKey: ['all'], modes: ['BEEPERON', 'BEEPER', 'BEEPER MUTE', 'GPS BEEP SATELLITE COUNT']},
38-
{ name: 'BLACKBOX', buildKey: ['all'], modes: ['BLACKBOX', 'BLACKBOX ERASE']},
39-
{ name: 'CAM', buildKey: ['cam'], modes: ['CAMERA CONTROL 1', 'CAMERA CONTROL 2', 'CAMERA CONTROL 3']},
40-
{ name: 'FLIGHTMODE', buildKey: ['all'], modes: flightModes},
41-
{ name: 'GPS', buildKey: ['gps'], modes: ['GPS BEEP SATELLITE COUNT', 'GPS RESCUE']},
42-
{ name: 'LED', buildKey: ['led_strip'], modes: ['LEDLOW']},
43-
{ name: 'OSD', buildKey: ['osd'], modes: ['OSD DISABLE']},
44-
{ name: 'OTHER', buildKey: ['all'], modes: ['CALIB', 'MSP OVERRIDE', 'LAP TIMER RESET', 'PASSTHRU', 'PARALYZE', 'PID AUDIO', 'PREARM']},
45-
{ name: 'SERVO', buildKey: ['servos'], modes: ['SERVO1', 'SERVO2', 'SERVO3']},
46-
{ name: 'TELEMETRI', buildKey: ['telemetry'], modes: ['TELEMETRY']},
47-
{ name: 'USER', buildKey: ['all'], modes: ['USER1', 'USER2', 'USER3', 'USER4']},
48-
{ name: 'VTX', buildKey: ['vtx'], modes: ['STICK COMMANDS DISABLE', 'VTX CONTROL DISABLE', 'VTX PIT MODE']},
34+
{ name: 'BEEP', buildKey: ['all'], modes: ['BEEPERON', 'BEEPER', 'BEEPER MUTE', 'GPS BEEP SATELLITE COUNT']},
35+
{ name: 'BLACKBOX', buildKey: ['all'], modes: ['BLACKBOX', 'BLACKBOX ERASE']},
36+
{ name: 'CAM', buildKey: ['cam'], modes: ['CAMERA CONTROL 1', 'CAMERA CONTROL 2', 'CAMERA CONTROL 3']},
37+
{ name: 'DSHOT / 3D', buildKey: ['dshot'], modes: ['3D', '3D DISABLE / SWITCH', 'FLIP OVER AFTER CRASH']},
38+
{ name: 'FLIGHT CONTROL', buildKey: ['all'], modes: flightControl},
39+
{ name: 'GPS / MAG', buildKey: ['gps_mag'], modes: ['GPS BEEP SATELLITE COUNT', 'GPS RESCUE', 'MAG']},
40+
{ name: 'LED', buildKey: ['led_strip'], modes: ['LEDLOW']},
41+
{ name: 'OSD', buildKey: ['osd'], modes: ['OSD DISABLE']},
42+
{ name: 'OTHER', buildKey: ['all'], modes: ['CALIB', 'MSP OVERRIDE', 'LAP TIMER RESET', 'PASSTHRU', 'PARALYZE', 'PID AUDIO', 'PREARM', 'READY']},
43+
{ name: 'SERVO', buildKey: ['servos'], modes: ['SERVO1', 'SERVO2', 'SERVO3']},
44+
{ name: 'TELEMETRY', buildKey: ['telemetry'], modes: ['TELEMETRY']},
45+
{ name: 'USER', buildKey: ['all'], modes: ['USER1', 'USER2', 'USER3', 'USER4']},
46+
{ name: 'VTX', buildKey: ['vtx'], modes: ['STICK COMMANDS DISABLE', 'VTX CONTROL DISABLE', 'VTX PIT MODE']},
4947
];
5048

5149
let modeList = [];
@@ -628,6 +626,9 @@ auxiliary.initialize = function (callback) {
628626
hasUsedMode = true;
629627
}
630628

629+
// setup categoryList to reflect changes when aux change
630+
updateSearchResults();
631+
631632
let hideUnused = hideUnusedModes && hasUsedMode;
632633

633634
for (let i = 1; i < FC.AUX_CONFIG.length; i++) { // ARM has index 0

0 commit comments

Comments
 (0)