On click of search result, show and focus conversation

Also: remove too-verbose logging on contact sync
This commit is contained in:
Scott Nonnenberg 2018-07-18 11:40:10 -07:00
parent 61bb038207
commit 0ac3517d51
4 changed files with 16 additions and 13 deletions

View file

@ -42,17 +42,22 @@
this.$new_contact = this.$('.new-contact');
this.typeahead = new Whisper.ConversationCollection();
this.collection = new Whisper.ConversationCollection([], {
comparator(m) {
return m.getTitle().toLowerCase();
},
});
this.listenTo(this.collection, 'select', conversation => {
this.resetTypeahead();
this.trigger('open', conversation);
});
// View to display the matched contacts from typeahead
this.typeahead_view = new Whisper.ConversationListView({
collection: new Whisper.ConversationCollection([], {
comparator(m) {
return m.getTitle().toLowerCase();
},
}),
collection: this.collection,
});
this.$el.append(this.typeahead_view.el);
this.initNewContact();
// this.listenTo(this.collection, 'reset', this.filterContacts);
this.pending = Promise.resolve();
},