Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local download of hex file #3182

Merged
merged 1 commit into from Dec 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/js/tabs/firmware_flasher.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down