fix: remove __fakeFileInput, clean up on destroy (#1025)

This commit is contained in:
Nolan Lawson 2019-02-19 21:50:41 -08:00 committed by GitHub
parent a63e85bf30
commit 44e3ea575e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -54,14 +54,10 @@
export default {
oncreate () {
// for testing
window.__fakeFileInput = (file) => {
this.onFileChange({
target: {
files: [file]
}
})
}
window.__composeToolbar = this // for testing
},
ondestroy () {
window.__composeToolbar = null
},
components: {
IconButton,

View File

@ -131,7 +131,9 @@ export const uploadKittenImage = i => (exec(() => {
let image = images[`kitten${i}`]
let blob = blobUtils.base64StringToBlob(image.data, 'image/png')
blob.name = image.name
window.__fakeFileInput(blob)
window.__composeToolbar.onFileChange({
target: { files: [blob] }
})
}, {
dependencies: {
images,