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>
This commit is contained in:
Daniel Calviño Sánchez 2018-03-21 03:57:14 +01:00
parent 6eb5cc5412
commit 9a0fbe307d
1 changed files with 6 additions and 0 deletions

View File

@ -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();