Move Whisper.events out of views and tests
This commit is contained in:
parent
a1c7369347
commit
40af226a4a
6 changed files with 13 additions and 6 deletions
|
@ -324,5 +324,16 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Whisper.events.on('unauthorized', function() {
|
||||||
|
if (owsDesktopApp.inboxView) {
|
||||||
|
owsDesktopApp.inboxView.networkStatusView.update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Whisper.events.on('reconnectTimer', function() {
|
||||||
|
if (owsDesktopApp.inboxView) {
|
||||||
|
owsDesktopApp.inboxView.networkStatusView.setSocketReconnectInterval(60000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -15,7 +15,9 @@
|
||||||
installView.hideDots();
|
installView.hideDots();
|
||||||
}
|
}
|
||||||
installView.$el.show();
|
installView.$el.show();
|
||||||
|
Whisper.events.on('contactsync:begin', installView.showSync, installView);
|
||||||
Whisper.events.on('contactsync', function() {
|
Whisper.events.on('contactsync', function() {
|
||||||
|
installView.close();
|
||||||
bg.openInbox();
|
bg.openInbox();
|
||||||
window.close();
|
window.close();
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,8 +49,6 @@
|
||||||
this.$('#step1').show();
|
this.$('#step1').show();
|
||||||
this.connect();
|
this.connect();
|
||||||
this.on('disconnected', this.reconnect);
|
this.on('disconnected', this.reconnect);
|
||||||
this.listenTo(Whisper.events, 'contactsync:begin', this.showSync);
|
|
||||||
this.listenTo(Whisper.events, 'contactsync', this.close);
|
|
||||||
},
|
},
|
||||||
connect: function() {
|
connect: function() {
|
||||||
this.clearQR();
|
this.clearQR();
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
window.addEventListener('online', this.update.bind(this));
|
window.addEventListener('online', this.update.bind(this));
|
||||||
window.addEventListener('offline', this.update.bind(this));
|
window.addEventListener('offline', this.update.bind(this));
|
||||||
Whisper.events.on('unauthorized', this.update, this);
|
|
||||||
Whisper.events.on('reconnectTimer', this.onReconnectTimer, this);
|
|
||||||
|
|
||||||
this.model = new Backbone.Model();
|
this.model = new Backbone.Model();
|
||||||
this.listenTo(this.model, 'change', this.onChange);
|
this.listenTo(this.model, 'change', this.onChange);
|
||||||
|
|
|
@ -45,7 +45,6 @@ window.assert = chai.assert;
|
||||||
window.Whisper = window.Whisper || {};
|
window.Whisper = window.Whisper || {};
|
||||||
window.Whisper.Database = window.Whisper.Database || {};
|
window.Whisper.Database = window.Whisper.Database || {};
|
||||||
Whisper.Database.id = 'test';
|
Whisper.Database.id = 'test';
|
||||||
Whisper.events = _.clone(Backbone.Events);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* global helpers for tests
|
* global helpers for tests
|
||||||
|
|
|
@ -12257,7 +12257,6 @@ window.assert = chai.assert;
|
||||||
window.Whisper = window.Whisper || {};
|
window.Whisper = window.Whisper || {};
|
||||||
window.Whisper.Database = window.Whisper.Database || {};
|
window.Whisper.Database = window.Whisper.Database || {};
|
||||||
Whisper.Database.id = 'test';
|
Whisper.Database.id = 'test';
|
||||||
Whisper.events = _.clone(Backbone.Events);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* global helpers for tests
|
* global helpers for tests
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue