From 62009832fe0f8869c4c6faa45ae5b4f4b5bde0f7 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 22 Feb 2019 18:14:21 +0700 Subject: [PATCH] Fixed uploading of images for staff users --- ghost/admin/app/components/gh-image-uploader.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ghost/admin/app/components/gh-image-uploader.js b/ghost/admin/app/components/gh-image-uploader.js index 62135fe111..d5ec51113a 100644 --- a/ghost/admin/app/components/gh-image-uploader.js +++ b/ghost/admin/app/components/gh-image-uploader.js @@ -30,7 +30,7 @@ export default Component.extend({ text: '', altText: '', saveButton: true, - accept: null, + accept: '', extensions: null, uploadUrl: null, validate: null, @@ -85,9 +85,8 @@ export default Component.extend({ return htmlSafe(`width: ${width}`); }), - didReceiveAttrs() { - let image = this.get('image'); - this.set('url', image); + init() { + this._super(...arguments); if (!this.get('accept')) { this.set('accept', this.get('_defaultAccept')); @@ -100,6 +99,11 @@ export default Component.extend({ } }, + didReceiveAttrs() { + let image = this.get('image'); + this.set('url', image); + }, + actions: { fileSelected(fileList, resetInput) { // can't use array destructuring here as FileList is not a strict