File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
resources/js/components/assets Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,8 @@ export default {
268268 handleUploadSuccess (id , response ) {
269269 this .$emit (' upload-complete' , response .data , this .uploads );
270270 this .uploads .splice (this .findUploadIndex (id), 1 );
271+
272+ this .handleToasts (response ._toasts ?? []);
271273 },
272274
273275 handleUploadError (id , status , response ) {
@@ -284,12 +286,19 @@ export default {
284286 msg = Object .values (response .errors )[0 ][0 ]; // Get first validation message.
285287 }
286288 }
289+
290+ this .handleToasts (response ._toasts ?? []);
291+
287292 upload .errorMessage = msg;
288293 upload .errorStatus = status;
289294 this .$emit (' error' , upload, this .uploads );
290295 this .processUploadQueue ();
291296 },
292297
298+ handleToasts (toasts ) {
299+ toasts .forEach (toast => Statamic .$toast [toast .type ](toast .message , {duration: toast .duration }));
300+ },
301+
293302 retry (id , args ) {
294303 let file = this .findUpload (id).instance .form .get (' file' );
295304 this .addFile (file, args);
You can’t perform that action at this time.
0 commit comments