diff --git a/frontend/vue/components/Admin/Branding/CustomAssetForm.vue b/frontend/vue/components/Admin/Branding/CustomAssetForm.vue index 9e3e6d304..bbe7f3c25 100644 --- a/frontend/vue/components/Admin/Branding/CustomAssetForm.vue +++ b/frontend/vue/components/Admin/Branding/CustomAssetForm.vue @@ -8,7 +8,7 @@ - + Clear Image @@ -37,6 +37,22 @@ export default { mounted() { this.relist(); }, + watch: { + file(newFile) { + if (null === newFile) { + return; + } + + let formData = new FormData(); + formData.append('file', this.file); + + this.$wrapWithLoading( + this.axios.post(this.apiUrl, formData) + ).finally(() => { + this.relist(); + }); + } + }, methods: { relist() { this.file = null; @@ -48,7 +64,6 @@ export default { this.loading = false; }); - }, clear() { this.$wrapWithLoading( @@ -57,20 +72,6 @@ export default { this.relist(); }); }, - upload() { - if (null === this.file) { - return; - } - - let formData = new FormData(); - formData.append('file', this.file); - - this.$wrapWithLoading( - this.axios.post(this.apiUrl, formData) - ).finally((resp) => { - this.relist(); - }); - }, } }