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

Replace invalid filesystem characters

This commit is contained in:
keyser84 2017-03-02 22:31:39 +00:00
parent 8d43a605d9
commit db46d752d4

View file

@ -170,6 +170,9 @@ function configuration_backup(callback) {
// generate timestamp for the backup file // generate timestamp for the backup file
var now = new Date().toISOString().split(".")[0]; var now = new Date().toISOString().split(".")[0];
// replace invalid filesystem characters
now = now.replace(new RegExp(':', 'g'), '_');
// create or load the file // create or load the file
chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'betaflight_backup_' + now + '.json', accepts: accepts}, function (fileEntry) { chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'betaflight_backup_' + now + '.json', accepts: accepts}, function (fileEntry) {
if (chrome.runtime.lastError) { if (chrome.runtime.lastError) {