mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -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>
|
<script>
|
||||||
// import axios from 'axios'
|
// 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'
|
import LinkButton from '~/components/link-button.vue'
|
||||||
|
|
@ -171,9 +171,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.scanner = new AppFilesScanner({
|
this.scanner = null
|
||||||
observableFilesArray: this.appsBeingScanned
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
log ( thing ) {
|
log ( thing ) {
|
||||||
|
|
@ -187,13 +185,27 @@ export default {
|
||||||
|
|
||||||
this.$refs['file-selector'].dispatchEvent(new MouseEvent('click'))
|
this.$refs['file-selector'].dispatchEvent(new MouseEvent('click'))
|
||||||
},
|
},
|
||||||
fileInputChanged () {
|
async fileInputChanged () {
|
||||||
this.isLoadingFiles = false
|
this.isLoadingFiles = false
|
||||||
// console.log('file-selector', this.$refs['file-selector'])
|
// console.log('file-selector', this.$refs['file-selector'])
|
||||||
|
|
||||||
// Get FileList from input
|
// Get FileList from input
|
||||||
const fileList = this.$refs['file-selector'].files
|
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)
|
// console.log('fileInputChanged files', fileList)
|
||||||
|
|
||||||
this.scanner.scan( fileList )
|
this.scanner.scan( fileList )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue