diff --git a/addon/controllers/products/index/category/new.js b/addon/controllers/products/index/category/new.js index 44d443d..d630c75 100644 --- a/addon/controllers/products/index/category/new.js +++ b/addon/controllers/products/index/category/new.js @@ -95,14 +95,15 @@ export default class ProductsIndexCategoryNewController extends BaseController { return; } + // Queue and upload immediatley this.uploadQueue.pushObject(file); this.fetch.uploadFile.perform( file, { path: `uploads/storefront/${this.activeStore.id}/products`, subject_uuid: this.product.id, - subject_type: `storefront:product`, - type: `storefront_product`, + subject_type: 'storefront:product', + type: 'storefront_product', }, (uploadedFile) => { this.product.files.pushObject(uploadedFile); @@ -116,6 +117,10 @@ export default class ProductsIndexCategoryNewController extends BaseController { }, () => { this.uploadQueue.removeObject(file); + // remove file from queue + if (file.queue && typeof file.queue.remove === 'function') { + file.queue.remove(file); + } } ); } diff --git a/addon/templates/products/index/category/new.hbs b/addon/templates/products/index/category/new.hbs index 355ab43..4ecb97d 100644 --- a/addon/templates/products/index/category/new.hbs +++ b/addon/templates/products/index/category/new.hbs @@ -214,7 +214,7 @@ class="min-h-56 dropzone w-full rounded-lg px-4 py-8 min-h bg-gray-50 dark:bg-gray-900 bg-opacity-25 text-gray-900 dark:text-white text-center flex flex-col items-center justify-center border-2 border-dashed border-gray-200 dark:border-indigo-500" >
Drag and drop image and video files onto this dropzone
+{{t "component.dropzone.dropzone-supported-images-videos"}}
{{/if}}