From 3e73282a648c66e2d054f4cf4f6ef59ace3cba3a Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 26 May 2015 17:08:14 -0700 Subject: [PATCH] Fix key verification screen --- js/views/conversation_view.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 2a72ef4e43eb..b8a9b9a3aa58 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -79,19 +79,21 @@ verifyIdentity: function() { if (this.model.isPrivate()) { - var number = this.model.id; - var view = new Whisper.KeyVerificationView({ - model: { - their_key: textsecure.storage.axolotl.getIdentityKey(number), - your_key: textsecure.storage.axolotl.getIdentityKey(textsecure.storage.user.getNumber()) - } - }); - this.$el.hide(); - view.render().$el.insertAfter(this.el); - this.listenTo(view, 'back', function() { - view.remove(); - this.$el.show(); - }); + var their_number = this.model.id; + var our_number = textsecure.storage.user.getNumber(); + textsecure.storage.axolotl.getIdentityKey(their_number).then(function(their_key) { + textsecure.storage.axolotl.getIdentityKey(our_number).then(function(our_key) { + var view = new Whisper.KeyVerificationView({ + model: { their_key: their_key, your_key: our_key } + }); + this.$el.hide(); + view.render().$el.insertAfter(this.el); + this.listenTo(view, 'back', function() { + view.remove(); + this.$el.show(); + }.bind(this)); + }.bind(this)); + }.bind(this)); } },