Remove usage of extension.trigger

This trigger function uses chrome's runtime message passing api, which
traverses between different windows in our runtime, but we only trigger
the updateInbox event from the backgroud page, so we don't need to use
that api, which requires some extra cpu/memory overhead.

// FREEBIE
This commit is contained in:
lilia 2015-07-15 14:08:58 -07:00
parent 2ad422afc8
commit 9dfff879b6
4 changed files with 8 additions and 9 deletions

View file

@ -41,15 +41,14 @@
}
});
function updateInbox() {
window.updateInbox = function() {
conversations.fetchActive().then(function() {
inbox.reset(conversations.filter(function(model) {
return model.get('active_at');
}));
});
}
};
extension.on('updateInbox', updateInbox);
updateInbox();
setUnreadCount(storage.get("unreadCount", 0));