Ensure final message before 'empty' is ready for notification (#1522)
Without this change, there's a race condition for the notification we show when we get the 'empty' event after a large backlog download. Four messages may have come in, but the last might not be notified. So the count shown would be three. And then, when the final message's notify() call finishes, another notification would be shown. FREEBIE
This commit is contained in:
parent
10a38297b8
commit
38152042d5
1 changed files with 9 additions and 5 deletions
|
@ -493,12 +493,16 @@
|
|||
// because we need to start expiration timers, etc.
|
||||
message.markRead();
|
||||
}
|
||||
if (message.get('unread')) {
|
||||
conversation.notify(message);
|
||||
}
|
||||
|
||||
confirm();
|
||||
return resolve();
|
||||
if (message.get('unread')) {
|
||||
conversation.notify(message).then(function() {
|
||||
confirm();
|
||||
return resolve();
|
||||
}, handleError);
|
||||
} else {
|
||||
confirm();
|
||||
return resolve();
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
handleError(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue