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.
This commit is contained in:
inetzo
2021-08-27 12:54:13 +02:00
committed by Sebastiaan Janssen
parent 2ae28c1e7a
commit d9135dd4ff

View File

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