From e0c1f0d27a5996d649f9625b7189afa22d0f3ab5 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Mon, 7 Aug 2017 12:41:24 -0700 Subject: [PATCH] MessageReceiver: Process cached before dismissing loading screen FREEBIE --- js/libtextsecure.js | 4 ++++ libtextsecure/message_receiver.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 29f0005b55e8..4ecf2e9f896f 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38283,6 +38283,10 @@ MessageReceiver.prototype.extend({ }); this.pending = this.queueAllCached(); + + // Ensures that an immediate 'empty' event from the websocket will fire only after + // all cached envelopes are processed. + this.incoming = [this.pending]; }, close: function() { this.socket.close(3000, 'called close'); diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 8a6d58c8ae39..9afb5e0340e5 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -34,6 +34,10 @@ MessageReceiver.prototype.extend({ }); this.pending = this.queueAllCached(); + + // Ensures that an immediate 'empty' event from the websocket will fire only after + // all cached envelopes are processed. + this.incoming = [this.pending]; }, close: function() { this.socket.close(3000, 'called close');