Don't request background page from background page

This file is loaded by the background page, which means it is already
bound to the background page's global context. This was not true at some
time in the distant past but is true now.

// FREEBIE
This commit is contained in:
lilia 2015-12-07 12:36:30 -08:00
parent 88ec5970d5
commit c1aada4f0f

View file

@ -6,16 +6,14 @@
window.Whisper = window.Whisper || {};
extension.windows.getBackground(function(bg) {
var SocketView = Whisper.View.extend({
className: 'status',
initialize: function() {
setInterval(this.updateStatus.bind(this), 5000);
},
updateStatus: function() {
extension.windows.getBackground(function(bg) {
var className, message = '';
switch(bg.getSocketStatus && bg.getSocketStatus()) {
switch(getSocketStatus && getSocketStatus()) {
case WebSocket.CONNECTING:
className = 'connecting';
break;
@ -34,7 +32,6 @@
this.$el.attr('class', className);
this.$el.text(message);
}
}.bind(this));
},
events: {
'click': 'reloadBackgroundPage'
@ -76,7 +73,7 @@
this.listenTo(this.newConversationView, 'open',
this.openConversation.bind(this, null));
var inboxCollection = bg.getInboxCollection();
var inboxCollection = getInboxCollection();
this.inboxListView = new Whisper.ConversationListView({
el : this.$('.inbox'),
collection : inboxCollection
@ -163,6 +160,5 @@
}
}
});
});
})();