Skip to content

Commit

Permalink
Bugfix #48
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdishman committed Sep 3, 2021
1 parent 34cf4b7 commit 579faf8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/post/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,13 @@ export default Vue.extend({
handleImage(e: Event): void {
// @ts-ignore
const image = e.target.files[0]
const reader = new FileReader()
reader.readAsDataURL(image)
reader.onload = (i) => {
if (i.target !== null) {
this.uploadImage(i.target.result)
if (image) {
const reader = new FileReader()
reader.readAsDataURL(image)
reader.onload = (i) => {
if (i.target !== null) {
this.uploadImage(i.target.result)
}
}
}
},
Expand Down

0 comments on commit 579faf8

Please sign in to comment.