From a3bf860be7f4e9085fc3bb569b411c08b89d38ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Tue, 6 Nov 2018 10:47:27 +0100 Subject: [PATCH] Fix sharedialog failure handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/js/sharedialoglinkshareview.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 4f4db0eec7..4ce337357a 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -251,11 +251,23 @@ } }, error: function() { + // empty function to override the default Dialog warning + } + })).fail(function(response) { + // password failure? Show error + self.password = '' + if (isPasswordEnforced && response && response.responseJSON && response.responseJSON.ocs.meta && response.responseJSON.ocs.meta.message) { + $input = self.$el.find('.pending #enforcedPassText') + $input.tooltip('destroy'); + $input.attr('title', response.responseJSON.ocs.meta.message); + $input.tooltip({placement: 'bottom', trigger: 'manual'}); + $input.tooltip('show'); + } else { OC.Notification.showTemporary(t('core', 'Unable to create a link share')); $loading.addClass('hidden'); $li.find('.icon').removeClass('hidden'); } - })).then(function(response) { + }).then(function(response) { // resolve before success newShareId = response.ocs.data.id });