mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-24 00:35:26 +03:00
Merge pull request #1012 from mikeller/fix_blackbox_write_error
Added abort / error message when writing of downloaded blackbox log fails.
This commit is contained in:
commit
cbd4c30857
2 changed files with 12 additions and 1 deletions
|
@ -6,6 +6,9 @@
|
|||
"message": "Betaflight Configurator",
|
||||
"description": "Title of the application window, usually not translated"
|
||||
},
|
||||
"error": {
|
||||
"message": "Error: {{errorMessage}}"
|
||||
},
|
||||
"warningTitle": {
|
||||
"message": "Warning"
|
||||
},
|
||||
|
|
|
@ -5,6 +5,7 @@ var
|
|||
|
||||
TABS.onboard_logging = {
|
||||
blockSize: 128,
|
||||
writeError: false,
|
||||
|
||||
BLOCK_SIZE: 4096,
|
||||
VCP_BLOCK_SIZE_3_0: 512,
|
||||
|
@ -409,7 +410,11 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
mark_saving_dialog_done(startTime, nextAddress, totalBytesCompressed);
|
||||
}
|
||||
} else {
|
||||
if (!self.writeError) {
|
||||
mspHelper.dataflashRead(nextAddress, self.blockSize, onChunkRead);
|
||||
} else {
|
||||
dismiss_saving_dialog();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -459,9 +464,12 @@ TABS.onboard_logging.initialize = function (callback) {
|
|||
|
||||
fileEntry.createWriter(function (fileWriter) {
|
||||
fileWriter.onerror = function (e) {
|
||||
GUI.log('<strong><span class="message-negative">' + i18n.getMessage('error', { errorMessage: e.target.error.message }) + '</span class="message-negative></strong>');
|
||||
|
||||
console.error(e);
|
||||
|
||||
// stop logging if the procedure was/is still running
|
||||
self.writeError = true;
|
||||
};
|
||||
|
||||
onComplete(fileWriter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue