mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-24 14:33:02 +02:00
Fix aggregate checklists updates.
This commit is contained in:
parent
b4392d0e3c
commit
950659b29d
1 changed files with 6 additions and 2 deletions
|
@ -182,11 +182,15 @@ void TodoLists::add(
|
|||
void TodoLists::toggleCompletion(FullMsgId itemId, int id, bool completed) {
|
||||
auto &entry = _toggles[itemId];
|
||||
if (completed) {
|
||||
if (!entry.completed.emplace(id).second) {
|
||||
const auto changed1 = entry.completed.emplace(id).second;
|
||||
const auto changed2 = entry.incompleted.remove(id);
|
||||
if (!changed1 && !changed2) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!entry.incompleted.emplace(id).second) {
|
||||
const auto changed1 = entry.incompleted.emplace(id).second;
|
||||
const auto changed2 = entry.completed.remove(id);
|
||||
if (!changed1 && !changed2) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue