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:
parent
6eb5cc5412
commit
9a0fbe307d
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue