background.js: Flow promises properly in error case
FREEBIE
This commit is contained in:
parent
39795170c1
commit
e36aa524c9
1 changed files with 5 additions and 1 deletions
|
@ -343,11 +343,15 @@
|
|||
if (!conversation_timestamp || message_timestamp > conversation_timestamp) {
|
||||
conversation.set({ timestamp: message.get('sent_at') });
|
||||
}
|
||||
conversation.save();
|
||||
|
||||
conversation.trigger('newmessage', message);
|
||||
if (initialLoadComplete) {
|
||||
conversation.notify(message);
|
||||
}
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
conversation.save().then(resolve, reject);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue