1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 17:55:24 +03:00

Auto merged - #2666 at Sat, 27 Nov 2021 08:17:11 GMT

Fixed Android File System
This commit is contained in:
J Blackman 2021-11-27 19:17:11 +11:00 committed by GitHub
commit 074c03f0e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -6220,7 +6220,7 @@
"message": "File name"
},
"dialogFileNameDescription": {
"message": "The file will be saved in the '{{folder}}' folder in your internal storage."
"message": "The file will be saved in the 'Android/data/betaflight-configurator/{{folder}}' folder in your internal storage."
},
"dialogFileAlreadyExistsTitle": {
"message": "This file already exists!"

View file

@ -309,7 +309,7 @@ const chromeapiFilesystem = {
options.suggestedName = 'newfile';
}
const extension = self.getFileExtension(options.suggestedName);
const folder = 'Betaflight configurator';
const folder = 'files';
navigator.notification.prompt(i18n.getMessage('dialogFileNameDescription', {
folder: folder,
}), function(res) {
@ -319,10 +319,9 @@ const chromeapiFilesystem = {
if (newExtension === undefined) {
fileName += `.${extension}`;
}
window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, function(rootEntry) {
window.resolveLocalFileSystemURL(cordova.file.externalApplicationStorageDirectory, function(rootEntry) {
rootEntry.getDirectory(folder, { create: true }, function(directoryEntry) {
directoryEntry.getFile(fileName, { create: false }, function(fileEntry) {
console.log(fileEntry);
navigator.notification.confirm(i18n.getMessage('dialogFileAlreadyExistsDescription'), function(resp) {
if (resp === 1) {
chromeCallbackWithSuccess(fileEntry, callback);