From 49031e07443a18efb7246c005076c427b535e201 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 23 Dec 2015 10:49:27 +0100 Subject: Fix unit tests --- core/js/sharedialogview.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/js/sharedialogview.js') diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index c89c1d95be9..4cebf7962e8 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -129,7 +129,7 @@ $loading.addClass('hidden'); $loading.removeClass('inlineblock'); if (result.ocs.meta.statuscode == 100) { - var users = [].concat(result.ocs.data.exact.users).concat(result.ocs.data.users); + var users = result.ocs.data.exact.users.concat(result.ocs.data.users); var groups = result.ocs.data.exact.groups.concat(result.ocs.data.groups); var remotes = result.ocs.data.exact.remotes.concat(result.ocs.data.remotes); @@ -195,8 +195,12 @@ var suggestions = users.concat(groups).concat(remotes); - $('.shareWithField').autocomplete("option", "autoFocus", true); - response(suggestions); + if (suggestions.length > 0) { + $('.shareWithField').autocomplete("option", "autoFocus", true); + response(suggestions); + } else { + response(); + } } else { response(); } -- cgit v1.2.3