diff --git a/src/localPage/functions.js b/src/localPage/functions.js index 2307c3f..366626b 100644 --- a/src/localPage/functions.js +++ b/src/localPage/functions.js @@ -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] diff --git a/src/localPage/index.js b/src/localPage/index.js index 321fd63..b133e4d 100644 --- a/src/localPage/index.js +++ b/src/localPage/index.js @@ -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 + } } }) \ No newline at end of file