mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
write to file IO bugfix
This commit is contained in:
parent
23ad4a9426
commit
7d4e7f8310
1 changed files with 9 additions and 0 deletions
|
@ -70,7 +70,16 @@ function configuration_backup() {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var truncated = false;
|
||||||
writer.onwriteend = function() {
|
writer.onwriteend = function() {
|
||||||
|
if (!truncated) {
|
||||||
|
// onwriteend will be fired again when truncation is finished
|
||||||
|
truncated = true;
|
||||||
|
writer.truncate(serialized_config_object.length);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Write SUCCESSFUL');
|
console.log('Write SUCCESSFUL');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue