background.js: Flow promises properly in error case

FREEBIE
pull/749/head
Scott Nonnenberg 8 years ago
parent 39795170c1
commit e36aa524c9

@ -343,11 +343,15 @@
if (!conversation_timestamp || message_timestamp > conversation_timestamp) { if (!conversation_timestamp || message_timestamp > conversation_timestamp) {
conversation.set({ timestamp: message.get('sent_at') }); conversation.set({ timestamp: message.get('sent_at') });
} }
conversation.save();
conversation.trigger('newmessage', message); conversation.trigger('newmessage', message);
if (initialLoadComplete) { if (initialLoadComplete) {
conversation.notify(message); conversation.notify(message);
} }
return new Promise(function(resolve, reject) {
conversation.save().then(resolve, reject);
});
}); });
}); });
} }

Loading…
Cancel
Save