From dede0f1e25bf1a9df964fc832e807817817e844e Mon Sep 17 00:00:00 2001 From: Daniel Gasienica Date: Thu, 22 Mar 2018 11:56:33 -0400 Subject: [PATCH] Improve user messaging during initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - We first show a localized loading message. - If initialization takes longer than a certain threshold, we show a different ‘optimization’ message. - If initialization is below the threshold the message change is canceled right before the regular loading screen. --- background.html | 2 +- js/background.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/background.html b/background.html index bbe333b59..b3a2517b4 100644 --- a/background.html +++ b/background.html @@ -961,7 +961,7 @@ -
Loading...
+
diff --git a/js/background.js b/js/background.js index 27018df5c..d72edc427 100644 --- a/js/background.js +++ b/js/background.js @@ -17,6 +17,7 @@ const { IdleDetector, MessageDataMigrator } = Signal.Workflow; const { Errors, Message } = window.Signal.Types; const { upgradeMessageSchema } = window.Signal.Migrations; + const { Views } = window.Signal; // Implicitly used in `indexeddb-backbonejs-adapter`: // https://github.com/signalapp/Signal-Desktop/blob/4033a9f8137e62ed286170ed5d4941982b1d3a64/components/indexeddb-backbonejs-adapter/backbone-indexeddb.js#L569 @@ -74,6 +75,8 @@ return accountManager; }; + const cancelInitializationMessage = Views.Initialization.setMessage(); + console.log('Start IndexedDB migrations'); storage.fetch(); @@ -163,6 +166,7 @@ connect(true); }); + cancelInitializationMessage(); var appView = window.owsDesktopApp.appView = new Whisper.AppView({el: $('body')}); Whisper.WallClockListener.init(Whisper.events);