Skip to content

Commit

Permalink
now settings can be remembered on app start
Browse files Browse the repository at this point in the history
  • Loading branch information
John4650-hub committed Sep 13, 2023
1 parent c1ee6e4 commit 9cbe5a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion routines.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
git add .
git commit -m "added saving file data"
git commit -m "now settings can be remembered on app start"
git push

28 changes: 13 additions & 15 deletions www/js/components/main_FileEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function onDeviceReady() {
$("#fileList").treeview({ data: getTree(), showBorder: false });
}, 2500)

applyEditorSettings()
applyEditorSettings()
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fs) {
/**
Expand All @@ -80,21 +80,19 @@ applyEditorSettings()
alert(`file ${filename} is not valid`)
}
}
fs.root.getFile('Android/data/com.ace.code/files/settings.json', {
create: true,
exclusive: false
}, function(fEntry) {
fEntry.file(function(file) {
let reader = new FileReader()
reader.onloadend = function() {
aceEditor.setOptions(JSON.parse(this.result))
}
reader.readAsText(file)
},(e)=>console.log());
},(e)=>console.log(e));

function applyEditorSettings() {
fs.root.getFile('Android/data/com.ace.code/files/settings.json', {
create: true,
exclusive: false
}, function(fEntry) {
fEntry.file(function(file) {
let reader = new FileReader()
reader.onloadend = function() {
aceEditor.setOptions(JSON.parse(this.result))
}
reader.readAsText(file)
}, null)
}, null)
}
window.getUrls = getUrls
let fE; //Helps to avoid saving the same data in various entries
function workWithFile(filePath) {
Expand Down

0 comments on commit 9cbe5a6

Please sign in to comment.