Fixed uploading of images for staff users

This commit is contained in:
Kevin Ansfield 2019-02-22 18:14:21 +07:00
parent 51fd4ffedb
commit 62009832fe

View File

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