Remove an extension.trigger
No need to trigger an extension-wide event now that all our models live in the background page. We can just update them more or less directly.
This commit is contained in:
parent
626b63ee7c
commit
06e8e0dca7
2 changed files with 12 additions and 3 deletions
|
@ -218,9 +218,10 @@
|
|||
var deliveries = message.get('delivered') || 0;
|
||||
var conversationId = message.get('conversationId');
|
||||
if (conversationId === pushMessage.source || groups.get(conversationId)) {
|
||||
message.save({delivered: deliveries + 1}).then(function() {
|
||||
extension.trigger('message', message); // notify frontend listeners
|
||||
});
|
||||
message.save({delivered: deliveries + 1}).then(
|
||||
// notify frontend listeners
|
||||
updateConversation.bind(window,conversationId)
|
||||
);
|
||||
return;
|
||||
// TODO: consider keeping a list of numbers we've
|
||||
// successfully delivered to?
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
return conversations.get(windowMap.modelIdFrom(windowId));
|
||||
};
|
||||
|
||||
window.updateConversation = function(conversationId) {
|
||||
var conversation = conversations.get(conversationId)
|
||||
if (conversation) {
|
||||
conversation.fetch();
|
||||
conversation.fetchMessages();
|
||||
}
|
||||
};
|
||||
|
||||
function closeConversation (windowId) {
|
||||
windowMap.remove('windowId', windowId);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue