From 9a0fbe307d1eb8583117e5c38ec1f4ae2b5e0f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Wed, 21 Mar 2018 03:57:14 +0100 Subject: [PATCH] Discard cached suggestions when adding a share MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The suggestions depend on the results returned by the server, but also on the sharees already shared with. Due to that adding a share changes the suggestions, so now the cached suggestions are discarded when a share is added. Signed-off-by: Daniel Calviño Sánchez --- core/js/sharedialogview.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 96f076c6a4..21fb03c7b0 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -445,6 +445,9 @@ $confirm.addClass('hidden'); this.model.addShare(s.item.value, {success: function() { + // Adding a share changes the suggestions. + self._lastSuggestions = undefined; + $(e.target).val('') .attr('disabled', false); $loading.addClass('hidden') @@ -525,6 +528,9 @@ $loading.removeClass('inlineblock'); $confirm.removeClass('hidden'); + // Adding a share changes the suggestions. + self._lastSuggestions = undefined; + $shareWithField.val(''); $shareWithField.prop('disabled', false); $shareWithField.focus();