summaryrefslogtreecommitdiffstats
path: root/core/js/sharedialogview.js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-21 03:57:14 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-03-21 04:34:14 +0100
commit9a0fbe307d1eb8583117e5c38ec1f4ae2b5e0f9a (patch)
tree659ac924f0185dda014e19994b3a67f56f7c0b48 /core/js/sharedialogview.js
parent6eb5cc54120168351286572b18bd1e07dc3bbc5c (diff)
downloadnextcloud-server-9a0fbe307d1eb8583117e5c38ec1f4ae2b5e0f9a.tar.gz
nextcloud-server-9a0fbe307d1eb8583117e5c38ec1f4ae2b5e0f9a.zip
Discard cached suggestions when adding a share
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 <danxuliu@gmail.com>
Diffstat (limited to 'core/js/sharedialogview.js')
-rw-r--r--core/js/sharedialogview.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index 96f076c6a47..21fb03c7b05 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();