Get install flow working in main window

// FREEBIE
This commit is contained in:
lilia 2017-03-30 18:11:13 -07:00 committed by Scott Nonnenberg
parent beb058aed6
commit 285b5ce062
No known key found for this signature in database
GPG key ID: A4931C09644C654B
7 changed files with 1159 additions and 18 deletions

View file

@ -96,6 +96,13 @@
Whisper.WallClockListener.init(Whisper.events);
Whisper.RotateSignedPreKeyListener.init(Whisper.events);
Whisper.ExpiringMessagesListener.init(Whisper.events);
if (Whisper.Registration.everDone()) {
openInbox();
}
if (!Whisper.Registration.isDone()) {
extension.install();
}
});
window.getSyncRequest = function() {

View file

@ -166,21 +166,21 @@
};
extension.install = function(mode) {
var id = 'installer';
var url = 'options.html';
if (mode === 'standalone') {
id = 'standalone-installer';
url = 'register.html';
return; // TODO
}
if (!chrome.app.window.get(id)) {
extension.windows.open({
id: id,
url: url,
bounds: { width: 800, height: 666, },
minWidth: 800,
minHeight: 666
});
var installView = new Whisper.InstallView({
el: $('body').empty()
});
if (Whisper.Registration.everDone()) {
installView.selectStep(3);
installView.hideDots();
}
installView.$el.show();
Whisper.events.once('contactsync', function() {
openInbox();
installView.remove();
});
};
var notification_pending = Promise.resolve();