From b0dbecb4e25350c9b2aeaa3cb33f4a2eb945d9b2 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Fri, 16 Jun 2017 11:51:08 -0700 Subject: [PATCH] Check trust store for identity key information on every new message It's debounced so it doesn't go too crazy. FREEBIE --- js/views/conversation_view.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 9ddab9c99..640a53297 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -106,6 +106,8 @@ this.listenTo(this.model, 'expired', this.onExpired); this.listenTo(this.model.messageCollection, 'expired', this.onExpiredCollection); + this.lazyUpdateVerified = _.debounce(this.model.updateVerified, 1000); + this.render(); new TimerMenuView({ el: this.$('.timer-menu'), model: this.model }); @@ -467,6 +469,9 @@ }, addMessage: function(message) { + // This is debounced, so it won't hit the database too often. + this.lazyUpdateVerified(); + this.model.messageCollection.add(message, {merge: true}); message.setToExpire();