Skip to content

Commit

Permalink
Hardcode display of export screen, of expired banner
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Nov 16, 2018
1 parent 0378cdf commit b8a5950
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 34 deletions.
3 changes: 0 additions & 3 deletions js/background.js
Expand Up @@ -126,9 +126,6 @@

function init(firstRun) {
window.removeEventListener('online', init);

// End of day, November 15th, 2018, Pacific Time (midnight the next day)
window.EXPIRATION_TIME = new Date('2018-11-16T08:00:00.000Z');
}

function onEmpty() {
Expand Down
5 changes: 4 additions & 1 deletion js/views/conversation_list_item_view.js
Expand Up @@ -25,9 +25,12 @@
this.listenTo(this.model.messageCollection, 'add remove', updateLastMessage);
this.listenTo(this.model, 'newmessage', updateLastMessage);

extension.windows.onClosed(this.stopListening.bind(this));
this.timeStampView = new Whisper.TimestampView({brief: true});
this.model.updateLastMessage();

if (extension.windows) {
extension.windows.onClosed(this.stopListening.bind(this));
}
},

markSelected: function() {
Expand Down
34 changes: 7 additions & 27 deletions js/views/inbox_view.js
Expand Up @@ -134,20 +134,13 @@
this.networkStatusView = new Whisper.NetworkStatusView();
this.$el.find('.network-status-container').append(this.networkStatusView.render().el);

extension.windows.onClosed(function() {
this.inboxListView.stopListening();
}.bind(this));
this.showUpgradeScreen();
this.showUpgradeBanner();

if (Whisper.Migration.inProgress()) {
if (this.appLoadingScreen) {
this.appLoadingScreen.remove();
this.appLoadingScreen = null;
}
this.showUpgradeScreen();
this.showUpgradeBanner();
}
else {
this.showUpgradeBanner();
if (extension.windows) {
extension.windows.onClosed(function() {
this.inboxListView.stopListening();
}.bind(this));
}
},
render_attributes: {
Expand Down Expand Up @@ -334,21 +327,8 @@
Backbone.View.prototype.remove.call(this);
},
render_attributes: function() {
var DAY = 1000 * 60 * 60 * 24;
var timeLeft = window.EXPIRATION_TIME.getTime() - Date.now();

if (timeLeft <= 0) {
return {
upgradeMessage: i18n('upgradeBannerExpired'),
upgradeNow: i18n('upgradeNow'),
};
}

var daysLeft = Math.floor(timeLeft / DAY);

return {
upgradeMessage: i18n('upgradeBanner'),
highlight: i18n('upgradeBannerTimespan', [daysLeft]),
upgradeMessage: i18n('upgradeBannerExpired'),
upgradeNow: i18n('upgradeNow'),
};
}
Expand Down
6 changes: 3 additions & 3 deletions js/views/migration_view.js
Expand Up @@ -294,9 +294,9 @@

cancel: function() {
Whisper.Migration.cancel().then(function() {
console.log('Restarting now');
window.location.reload();
});
console.log('Removing migration view');
this.remove();
}.bind(this));
},
selectStep: function(step) {
this.step = step;
Expand Down

0 comments on commit b8a5950

Please sign in to comment.