Skip to content

Commit

Permalink
Allow erase_chip to be disabled during session
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Jan 4, 2024
1 parent 4c5a914 commit 53af9d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function cleanupLocalStorage() {
'selected_board',
'unifiedConfigLast',
'unifiedSourceCache',
'erase_chip',
];

for (const key in localStorage) {
Expand All @@ -83,6 +84,8 @@ function cleanupLocalStorage() {
}
}
}

setConfig({'erase_chip': true}); // force erase chip on first run
}

function appReady() {
Expand Down
5 changes: 3 additions & 2 deletions src/js/tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,13 +574,14 @@ firmware_flasher.initialize = function (callback) {
self.isFlashing = false;
}

$('input.erase_chip').prop('checked', true); // force true because people flashing without regard for new configs
let result = getConfig('erase_chip');
$('input.erase_chip').prop('checked', result.erase_chip); // users can override this during the session

$('input.erase_chip').change(function () {
setConfig({'erase_chip': $(this).is(':checked')});
}).change();

let result = getConfig('show_development_releases');
result = getConfig('show_development_releases');
$('input.show_development_releases')
.prop('checked', result.show_development_releases)
.change(function () {
Expand Down

0 comments on commit 53af9d6

Please sign in to comment.