Correct unread counter after first topic open.
This commit is contained in:
parent
1a9c6749ae
commit
33c0c79593
|
@ -860,7 +860,13 @@ std::optional<int> RepliesList::computeUnreadCountLocally(
|
||||||
MsgId afterId) const {
|
MsgId afterId) const {
|
||||||
Expects(afterId >= _inboxReadTillId);
|
Expects(afterId >= _inboxReadTillId);
|
||||||
|
|
||||||
const auto wasUnreadCountAfter = _unreadCount.current();
|
const auto currentUnreadCountAfter = _unreadCount.current();
|
||||||
|
const auto startingMarkingAsRead = (currentUnreadCountAfter == 0)
|
||||||
|
&& (_inboxReadTillId == 1)
|
||||||
|
&& (afterId > 1);
|
||||||
|
const auto wasUnreadCountAfter = startingMarkingAsRead
|
||||||
|
? _fullCount.current().value_or(0)
|
||||||
|
: currentUnreadCountAfter;
|
||||||
const auto readTillId = std::max(afterId, _rootId);
|
const auto readTillId = std::max(afterId, _rootId);
|
||||||
const auto wasReadTillId = _inboxReadTillId;
|
const auto wasReadTillId = _inboxReadTillId;
|
||||||
const auto backLoaded = (_skippedBefore == 0);
|
const auto backLoaded = (_skippedBefore == 0);
|
||||||
|
|
Loading…
Reference in New Issue