Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions src/js/tabs/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,20 @@ setup.initialize = function (callback) {
}
};

// Fills in the "Build type" part of the "Firmware info" box
const showBuildType = function () {
build_type_e.html(
FC.CONFIG.buildKey.length === 32
? i18n.getMessage("initialSetupInfoBuildCloud")
: i18n.getMessage("initialSetupInfoBuildLocal"),
);
};

// Hides the "Build type" part of the "Firmware info" box
const hideBuildType = function () {
build_type_e.parent().hide();
};

function showDialogBuildInfo(title, message) {
const dialog = $(".dialogBuildInfo")[0];

Expand Down Expand Up @@ -404,6 +418,11 @@ setup.initialize = function (callback) {
}
};

// Hides the "Build info" part of the "Firmware info" box
const hideBuildInfo = function () {
build_info_e.parent().hide();
};

// Fills in the "Firmware" part of the "Firmware info" box
const showBuildFirmware = function () {
const isIspConnected = ispConnected();
Expand Down Expand Up @@ -460,19 +479,24 @@ setup.initialize = function (callback) {
}
};

// Hides the "Firmware" part of the "Firmware info" box
const hideBuildFirmware = function () {
build_firmware_e.parent().hide();
};

// Fills in the "Firmware info" box
function showFirmwareInfo() {
msp_api_e.text(FC.CONFIG.apiVersion);
build_date_e.text(FC.CONFIG.buildInfo);

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45)) {
build_type_e.html(
FC.CONFIG.buildKey.length === 32
? i18n.getMessage("initialSetupInfoBuildCloud")
: i18n.getMessage("initialSetupInfoBuildLocal"),
);
showBuildType();
showBuildInfo();
showBuildFirmware();
} else {
hideBuildType();
hideBuildInfo();
hideBuildFirmware();
}
}

Expand Down