Fix lint warnings
This commit is contained in:
parent
9e79ecddf8
commit
e8b4bd708e
2 changed files with 11 additions and 7 deletions
|
@ -162,6 +162,13 @@
|
||||||
// lazy hack
|
// lazy hack
|
||||||
window.receipts = new Backbone.Collection();
|
window.receipts = new Backbone.Collection();
|
||||||
|
|
||||||
|
function updateConversation(conversationId) {
|
||||||
|
var conversation = ConversationController.get(conversationId);
|
||||||
|
if (conversation) {
|
||||||
|
conversation.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function onDeliveryReceipt(ev) {
|
function onDeliveryReceipt(ev) {
|
||||||
var pushMessage = ev.proto;
|
var pushMessage = ev.proto;
|
||||||
var timestamp = pushMessage.timestamp.toNumber();
|
var timestamp = pushMessage.timestamp.toNumber();
|
||||||
|
@ -175,13 +182,10 @@
|
||||||
var deliveries = message.get('delivered') || 0;
|
var deliveries = message.get('delivered') || 0;
|
||||||
var conversationId = message.get('conversationId');
|
var conversationId = message.get('conversationId');
|
||||||
if (conversationId === pushMessage.source || groups.get(conversationId)) {
|
if (conversationId === pushMessage.source || groups.get(conversationId)) {
|
||||||
message.save({delivered: deliveries + 1}).then(function() {
|
message.save({delivered: deliveries + 1}).then(
|
||||||
// notify frontend listeners
|
// notify frontend listeners
|
||||||
var conversation = ConversationController.get(conversationId);
|
updateConversation.bind(null, conversationId)
|
||||||
if (conversation) {
|
);
|
||||||
conversation.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
// TODO: consider keeping a list of numbers we've
|
// TODO: consider keeping a list of numbers we've
|
||||||
// successfully delivered to?
|
// successfully delivered to?
|
||||||
|
|
|
@ -124,7 +124,7 @@
|
||||||
openInbox();
|
openInbox();
|
||||||
var appWindow = chrome.app.window.get(inboxWindowId);
|
var appWindow = chrome.app.window.get(inboxWindowId);
|
||||||
appWindow.contentWindow.trigger('open', {conversation: conversation});
|
appWindow.contentWindow.trigger('open', {conversation: conversation});
|
||||||
};
|
}
|
||||||
|
|
||||||
/* Inbox window controller */
|
/* Inbox window controller */
|
||||||
var inboxOpened = false;
|
var inboxOpened = false;
|
||||||
|
|
Loading…
Reference in a new issue