From d9135dd4ffda45f529fe49dffff3c270bd29ada5 Mon Sep 17 00:00:00 2001 From: inetzo Date: Fri, 27 Aug 2021 12:54:13 +0200 Subject: [PATCH] Check if umbFileDropzone has queued items before showing ChooseMediaTypeDialog The ChooseMediaTypeDialog is shown even if there are no queue items, for example due file errors. Checking the queue lenght in _requestChooseMediaTypeDialog prevents showing the dialog unnecessary. --- .../components/upload/umbfiledropzone.directive.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js index d80b884dab..e926ca23d7 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/upload/umbfiledropzone.directive.js @@ -187,6 +187,11 @@ angular.module("umbraco.directives") function _requestChooseMediaTypeDialog() { + if (scope.queue.length === 0) { + // if queue has no items so there is nothing to choose a type for + return false; + } + if (scope.acceptedMediatypes.length === 1) { // if only one accepted type, then we wont ask to choose. return false;