Improve user messaging during initialization

- 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.
This commit is contained in:
Daniel Gasienica 2018-03-22 11:56:33 -04:00
parent add19aa732
commit dede0f1e25
2 changed files with 5 additions and 1 deletions

View File

@ -961,7 +961,7 @@
<span class='dot'></span>
<span class='dot'></span>
</div>
<div class='message'>Loading...</div>
<div class='message'></div>
</div>
</div>

View File

@ -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);