1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

Fix local download of hex file (#3182)

This commit is contained in:
Míguel Ángel Mulero Martínez 2022-12-30 01:44:57 +01:00 committed by GitHub
parent 3d6a690ccd
commit bf69053da5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -814,6 +814,9 @@ firmware_flasher.initialize = function (callback) {
self.releaseLoader.requestBuild(request, (info) => {
console.info("Build requested:", info);
// Complete the summary object to be used later
summary.file = info.file;
if (!summary.cloudBuild) {
// it is a previous release, so simply load the hex
self.releaseLoader.loadTargetHex(info.url, (hex) => onLoadSuccess(hex, info.file), onLoadFailed);
@ -1008,9 +1011,8 @@ firmware_flasher.initialize = function (callback) {
}
}
$('span.progressLabel a.save_firmware').click(function () {
const summary = $('select[name="firmware_version"] option:selected').data('summary');
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: summary.file, accepts: [{description: 'HEX files', extensions: ['hex']}]}, function (fileEntry) {
$('span.progressLabel').on('click', 'a.save_firmware', function () {
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: self.summary.file, accepts: [{description: 'HEX files', extensions: ['hex']}]}, function (fileEntry) {
if (checkChromeRuntimeError()) {
return;
}