Fix sharedialog failure handler

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-11-06 10:47:27 +01:00
parent eeeb19079f
commit a3bf860be7
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

View file

@ -251,11 +251,23 @@
} }
}, },
error: function() { 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')); OC.Notification.showTemporary(t('core', 'Unable to create a link share'));
$loading.addClass('hidden'); $loading.addClass('hidden');
$li.find('.icon').removeClass('hidden'); $li.find('.icon').removeClass('hidden');
} }
})).then(function(response) { }).then(function(response) {
// resolve before success // resolve before success
newShareId = response.ocs.data.id newShareId = response.ocs.data.id
}); });