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

pull/1026/head
Nolan Lawson 2019-02-19 21:50:41 -08:00 zatwierdzone przez GitHub
rodzic a63e85bf30
commit 44e3ea575e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 7 dodań i 9 usunięć

Wyświetl plik

@ -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,

Wyświetl plik

@ -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,