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

Remove size limit of local flash file

This commit is contained in:
Miguel Angel Mulero Martinez 2019-07-04 18:40:23 +02:00
parent e38afdcf46
commit f1ec75e939
2 changed files with 1 additions and 17 deletions

View file

@ -379,22 +379,9 @@ TABS.firmware_flasher.initialize = function (callback) {
analytics.setFirmwareData(analytics.DATA.FIRMWARE_NAME, file.name);
var reader = new FileReader();
// Max size in bytes of the local file to load and flash
const MAX_FLASH_LOCAL_FILE_SIZE = 2*1024*1024;
reader.onprogress = function (e) {
if (e.total > MAX_FLASH_LOCAL_FILE_SIZE) {
reader.abort();
}
};
reader.onloadend = function(e) {
if (e.total > MAX_FLASH_LOCAL_FILE_SIZE) {
console.log('File limit (' + MAX_FLASH_LOCAL_FILE_SIZE + ') exceeded, aborting');
$('span.progressLabel').text(i18n.getMessage('firmwareFlasherTooBig', e.total));
} else if (e.total != 0 && e.total == e.loaded) {
if (e.total != 0 && e.total == e.loaded) {
console.log('File loaded (' + e.loaded + ')');