From 6a98fc8278d375cedb5713a4c1f6a870f5ad6067 Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 6 Jul 2015 12:07:47 -0700 Subject: [PATCH] Reload contacts when resetting a recipients input Fixes #272 // FREEBIE --- js/views/recipients_input_view.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/views/recipients_input_view.js b/js/views/recipients_input_view.js index 1e446b9f6f3..62bf6975418 100644 --- a/js/views/recipients_input_view.js +++ b/js/views/recipients_input_view.js @@ -26,7 +26,10 @@ ], database: Whisper.Database, storeName: 'conversations', - model: Whisper.Conversation + model: Whisper.Conversation, + fetchContacts: function() { + this.fetch({ conditions: { type: 'private' } }); + } }); Whisper.ContactPillView = Whisper.View.extend({ @@ -79,7 +82,7 @@ // Collection of contacts to match user input against this.typeahead = new ContactsTypeahead(); - this.typeahead.fetch({ conditions: { type: 'private' } }); + this.typeahead.fetchContacts(); // View to display the matched contacts from typeahead this.typeahead_view = new Whisper.ConversationListView({ @@ -164,6 +167,7 @@ ); this.recipients.reset([]); this.resetTypeahead(); + this.typeahead.fetchContacts(); }, resetTypeahead: function() {