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

write to file IO bugfix

This commit is contained in:
cTn 2014-02-22 21:23:06 +01:00
parent 23ad4a9426
commit 7d4e7f8310

View file

@ -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');
}; };