2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Correctly clear story instances on deletion.

This commit is contained in:
John Preston
2023-07-21 12:18:16 +04:00
parent 76f7a870ed
commit b7370127ff
4 changed files with 32 additions and 5 deletions

View File

@@ -723,6 +723,16 @@ void Stories::applyDeleted(FullStoryId id) {
}
_owner->refreshStoryItemViews(id);
Assert(!_pollingSettings.contains(story.get()));
if (const auto j = _items.find(id.peer); j != end(_items)) {
const auto k = j->second.find(id.story);
if (k != end(j->second)) {
Assert(!k->second.lock());
j->second.erase(k);
if (j->second.empty()) {
_items.erase(j);
}
}
}
if (i->second.empty()) {
_stories.erase(i);
}