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

@ -597,11 +597,6 @@
const { expireTimer } = details; const { expireTimer } = details;
const isValidExpireTimer = typeof expireTimer === 'number'; const isValidExpireTimer = typeof expireTimer === 'number';
if (!isValidExpireTimer) { if (!isValidExpireTimer) {
console.log(
'Ignore invalid expire timer.',
'Expected numeric `expireTimer`, got:',
expireTimer
);
return; return;
} }

View file

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

View file

@ -115,8 +115,11 @@ input.search {
position: relative; position: relative;
border-radius: 4px; border-radius: 4px;
&.active { &:focus {
outline: solid 1px $blue; outline: solid 1px $blue;
}
&.active {
background-image: url('../images/x.svg'); background-image: url('../images/x.svg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: $search-x-size; background-size: $search-x-size;

View file

@ -460,7 +460,7 @@ body.dark-theme {
color: $color-dark-05; color: $color-dark-05;
background-color: $color-black; background-color: $color-black;
&.active { &:focus {
outline: solid 1px $blue; outline: solid 1px $blue;
} }
} }