aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/sharedialogview.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/sharedialogview.js')
-rw-r--r--core/js/sharedialogview.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 9e3de2636ce..7c31239d4a1 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -242,7 +242,7 @@
deferred.resolve(suggestions);
} else {
- deferred.resolve(null);
+ deferred.reject(result.ocs.meta.message);
}
}
).fail(function() {
@@ -296,7 +296,7 @@
$loading.removeClass('inlineblock');
$confirm.removeClass('hidden');
- if (suggestions && suggestions.length > 0) {
+ if (suggestions.length > 0) {
$shareWithField
.autocomplete("option", "autoFocus", true);
@@ -312,7 +312,7 @@
$('.ui-autocomplete').append('<li class="autocomplete-note">' + message + '</li>');
}
- } else if (suggestions) {
+ } else {
var title = t('core', 'No users or groups found for {search}', {search: $shareWithField.val()});
if (!view.configModel.get('allowGroupSharing')) {
title = t('core', 'No users found for {search}', {search: $('.shareWithField').val()});
@@ -327,14 +327,17 @@
.tooltip('fixTitle')
.tooltip('show');
response();
- } else {
- response();
}
- }).fail(function() {
+ }).fail(function(message) {
$loading.addClass('hidden');
$loading.removeClass('inlineblock');
$confirm.removeClass('hidden');
- OC.Notification.showTemporary(t('core', 'An error occurred. Please try again'));
+
+ if (message) {
+ OC.Notification.showTemporary(t('core', 'An error occurred ("{message}"). Please try again', { message: message }));
+ } else {
+ OC.Notification.showTemporary(t('core', 'An error occurred. Please try again'));
+ }
});
},