From 42c24dd098c8a279ff2c5466298a19b86abbbf5f Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 22 Feb 2018 11:14:26 -0800 Subject: [PATCH] Enable conversation open when app started offline (#2064) Turns out textsecure.messaging is only set up on first connection to the server. When we start up offline, we never do that. And it prevents the user from opening every conversation. There's a whole lot more to do to bulletproof ourselves against a missing textsecure.messaging (and then beyond that, queuing outgoing messages so they don't get dropped completely when offline). Hence, it's a band-aid. --- js/models/conversations.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/models/conversations.js b/js/models/conversations.js index 45bc96c94..6ed49da82 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -911,6 +911,11 @@ }, getProfile: function(id) { + if (!textsecure.messaging) { + var message = 'Conversation.getProfile: textsecure.messaging not available'; + return Promise.reject(new Error(message)); + } + return textsecure.messaging.getProfile(id).then(function(profile) { var identityKey = dcodeIO.ByteBuffer.wrap(profile.identityKey, 'base64').toArrayBuffer();