mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-18 18:03:27 +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) {
|
void TodoLists::toggleCompletion(FullMsgId itemId, int id, bool completed) {
|
||||||
auto &entry = _toggles[itemId];
|
auto &entry = _toggles[itemId];
|
||||||
if (completed) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} 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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue