Don't schedule unread badge updates while quitting

This commit is contained in:
John Preston
2026-07-16 08:51:11 +04:00
parent eba0ff002d
commit 0906cc199d

View File

@@ -257,7 +257,7 @@ void Domain::updateUnreadBadge() {
}
void Domain::scheduleUpdateUnreadBadge() {
if (_unreadBadgeUpdateScheduled) {
if (_unreadBadgeUpdateScheduled || Core::Quitting()) {
return;
}
_unreadBadgeUpdateScheduled = true;
@@ -362,9 +362,11 @@ void Domain::watchSession(not_null<Account*> account) {
}) | rpl::on_next([=] {
scheduleUpdateUnreadBadge();
closeAccountWindows(account);
crl::on_main(&Core::App(), [=] {
removeRedundantAccounts();
});
if (!Core::Quitting()) {
crl::on_main(&Core::App(), [=] {
removeRedundantAccounts();
});
}
}, account->lifetime());
}