Conversation.markRead() - wait for all database saves are complete

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-07-28 15:12:51 -07:00
parent 0b4d14e5ac
commit 6f1a2a9b3e
2 changed files with 12 additions and 4 deletions

View file

@ -533,7 +533,9 @@
Whisper.Notifications.remove(Whisper.Notifications.where({
messageId: this.id
}));
return this.save();
return new Promise(function(resolve, reject) {
this.save().then(resolve, reject);
}.bind(this));
},
isExpiring: function() {
return this.get('expireTimer') && this.get('expirationStartTimestamp');