summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-06 10:47:27 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-11-06 10:47:27 +0100
commita3bf860be7f4e9085fc3bb569b411c08b89d38ea (patch)
tree4cd6361c79372b2c6bd82924c71ba0ff410f6370 /core
parenteeeb19079f3c6a8893f451ca8abb2f5d585390ed (diff)
downloadnextcloud-server-a3bf860be7f4e9085fc3bb569b411c08b89d38ea.tar.gz
nextcloud-server-a3bf860be7f4e9085fc3bb569b411c08b89d38ea.zip
Fix sharedialog failure handler
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/js/sharedialoglinkshareview.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 4f4db0eec79..4ce337357a0 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
});