mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 01:35:28 +03:00
Fixed Android File System
This commit is contained in:
parent
dd183f0412
commit
c5bb584520
2 changed files with 3 additions and 4 deletions
|
@ -6141,7 +6141,7 @@
|
||||||
"message": "File name"
|
"message": "File name"
|
||||||
},
|
},
|
||||||
"dialogFileNameDescription": {
|
"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": {
|
"dialogFileAlreadyExistsTitle": {
|
||||||
"message": "This file already exists!"
|
"message": "This file already exists!"
|
||||||
|
|
5
src/js/cordova_chromeapi.js
vendored
5
src/js/cordova_chromeapi.js
vendored
|
@ -309,7 +309,7 @@ const chromeapiFilesystem = {
|
||||||
options.suggestedName = 'newfile';
|
options.suggestedName = 'newfile';
|
||||||
}
|
}
|
||||||
const extension = self.getFileExtension(options.suggestedName);
|
const extension = self.getFileExtension(options.suggestedName);
|
||||||
const folder = 'Betaflight configurator';
|
const folder = 'files';
|
||||||
navigator.notification.prompt(i18n.getMessage('dialogFileNameDescription', {
|
navigator.notification.prompt(i18n.getMessage('dialogFileNameDescription', {
|
||||||
folder: folder,
|
folder: folder,
|
||||||
}), function(res) {
|
}), function(res) {
|
||||||
|
@ -319,10 +319,9 @@ const chromeapiFilesystem = {
|
||||||
if (newExtension === undefined) {
|
if (newExtension === undefined) {
|
||||||
fileName += `.${extension}`;
|
fileName += `.${extension}`;
|
||||||
}
|
}
|
||||||
window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, function(rootEntry) {
|
window.resolveLocalFileSystemURL(cordova.file.externalApplicationStorageDirectory, function(rootEntry) {
|
||||||
rootEntry.getDirectory(folder, { create: true }, function(directoryEntry) {
|
rootEntry.getDirectory(folder, { create: true }, function(directoryEntry) {
|
||||||
directoryEntry.getFile(fileName, { create: false }, function(fileEntry) {
|
directoryEntry.getFile(fileName, { create: false }, function(fileEntry) {
|
||||||
console.log(fileEntry);
|
|
||||||
navigator.notification.confirm(i18n.getMessage('dialogFileAlreadyExistsDescription'), function(resp) {
|
navigator.notification.confirm(i18n.getMessage('dialogFileAlreadyExistsDescription'), function(resp) {
|
||||||
if (resp === 1) {
|
if (resp === 1) {
|
||||||
chromeCallbackWithSuccess(fileEntry, callback);
|
chromeCallbackWithSuccess(fileEntry, callback);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue