Remove global updateInbox, used scoped version
// FREEBIE
This commit is contained in:
parent
949cb8d8e3
commit
0509bb0f5d
3 changed files with 5 additions and 9 deletions
|
@ -132,13 +132,13 @@
|
||||||
var message = initIncomingMessage(envelope.source, envelope.timestamp.toNumber());
|
var message = initIncomingMessage(envelope.source, envelope.timestamp.toNumber());
|
||||||
if (e.name === 'IncomingIdentityKeyError') {
|
if (e.name === 'IncomingIdentityKeyError') {
|
||||||
message.save({ errors : [e] }).then(function() {
|
message.save({ errors : [e] }).then(function() {
|
||||||
updateInbox();
|
ConversationController.updateInbox();
|
||||||
notifyConversation(message);
|
notifyConversation(message);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else if (e.message !== 'Bad MAC') {
|
} else if (e.message !== 'Bad MAC') {
|
||||||
message.save({ errors : [ _.pick(e, ['name', 'message'])]}).then(function() {
|
message.save({ errors : [ _.pick(e, ['name', 'message'])]}).then(function() {
|
||||||
updateInbox();
|
ConversationController.updateInbox();
|
||||||
notifyConversation(message);
|
notifyConversation(message);
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
timestamp : now,
|
timestamp : now,
|
||||||
lastMessage : body
|
lastMessage : body
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
updateInbox();
|
ConversationController.updateInbox();
|
||||||
});
|
});
|
||||||
|
|
||||||
var sendFunc;
|
var sendFunc;
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
});
|
});
|
||||||
if (keyErrors.length) {
|
if (keyErrors.length) {
|
||||||
message.save({ errors : keyErrors }).then(function() {
|
message.save({ errors : keyErrors }).then(function() {
|
||||||
updateInbox();
|
ConversationController.updateInbox();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!(errors instanceof Array)) {
|
if (!(errors instanceof Array)) {
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
_.each(models, function(message) { message.destroy(); });
|
_.each(models, function(message) { message.destroy(); });
|
||||||
this.archive();
|
this.archive();
|
||||||
return this.save().then(function() {
|
return this.save().then(function() {
|
||||||
updateInbox();
|
ConversationController.updateInbox();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -63,10 +63,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.updateInbox = function() { // TODO: remove
|
|
||||||
ConversationController.updateInbox();
|
|
||||||
};
|
|
||||||
|
|
||||||
ConversationController.updateInbox();
|
ConversationController.updateInbox();
|
||||||
setUnreadCount(storage.get("unreadCount", 0));
|
setUnreadCount(storage.get("unreadCount", 0));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue