mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Delay scanner code load until files are picked
This commit is contained in:
parent
cd8dba8c95
commit
534e5b8047
1 changed files with 17 additions and 5 deletions
|
|
@ -129,7 +129,7 @@
|
|||
<script>
|
||||
// import axios from 'axios'
|
||||
|
||||
import AppFilesScanner from '~/helpers/app-files-scanner.js'
|
||||
// import AppFilesScanner from '~/helpers/app-files-scanner.js'
|
||||
|
||||
|
||||
import LinkButton from '~/components/link-button.vue'
|
||||
|
|
@ -171,9 +171,7 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
this.scanner = new AppFilesScanner({
|
||||
observableFilesArray: this.appsBeingScanned
|
||||
})
|
||||
this.scanner = null
|
||||
},
|
||||
methods: {
|
||||
log ( thing ) {
|
||||
|
|
@ -187,13 +185,27 @@ export default {
|
|||
|
||||
this.$refs['file-selector'].dispatchEvent(new MouseEvent('click'))
|
||||
},
|
||||
fileInputChanged () {
|
||||
async fileInputChanged () {
|
||||
this.isLoadingFiles = false
|
||||
// console.log('file-selector', this.$refs['file-selector'])
|
||||
|
||||
// Get FileList from input
|
||||
const fileList = this.$refs['file-selector'].files
|
||||
|
||||
// If the scanner instance is not set up yet
|
||||
// then create and initialize it
|
||||
if ( this.scanner === null ) {
|
||||
console.log('Initializing scanner instance')
|
||||
|
||||
// Bring in code
|
||||
const { default: AppFilesScanner} = await import('~/helpers/app-files-scanner.js')
|
||||
|
||||
// Initialize instance
|
||||
this.scanner = new AppFilesScanner({
|
||||
observableFilesArray: this.appsBeingScanned
|
||||
})
|
||||
}
|
||||
|
||||
// console.log('fileInputChanged files', fileList)
|
||||
|
||||
this.scanner.scan( fileList )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue