Typo on function name + added a alreadyLoaded token on localPage

This commit is contained in:
Kylart 2017-03-05 20:38:33 +01:00
parent 434af64850
commit c5c1a92bce
2 changed files with 9 additions and 3 deletions

View File

@ -104,7 +104,8 @@ exports.delFile = (object, name) => {
})
}
exports.changePathDiaog = (object) => {
exports.changePathDialog = (object) => {
// TODO: Find a way to catch TypeError on escape press of Dialog.
dialog.showOpenDialog({properties: ['openDirectory']}, (dirPath) => {
object.files = []
object.currentDir = dirPath[0]

View File

@ -91,6 +91,7 @@ Vue.component('local-page', {
return {
files: [],
currentDir: functions.DIR,
alreadyLoaded: false,
elemStyle: {
marginBottom: '1.5%'
},
@ -122,7 +123,7 @@ Vue.component('local-page', {
functions.delFile(this, name)
},
changeDir: function () {
functions.changePathDiaog(this)
functions.changePathDialog(this)
},
refreshDir: function () {
this.files = []
@ -130,6 +131,10 @@ Vue.component('local-page', {
}
},
created: function () {
this.findFiles()
if (!this.alreadyLoaded)
{
this.findFiles()
this.alreadyloaded = true
}
}
})