From 0128f6af0a47d668f77115501b3731e4316d4e36 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Fri, 14 Oct 2022 16:57:50 +0400 Subject: [PATCH] Fix animation --- .../ChatListUI/Sources/Node/ChatListNode.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/submodules/ChatListUI/Sources/Node/ChatListNode.swift b/submodules/ChatListUI/Sources/Node/ChatListNode.swift index 8689e3a0ed..2aa25ea676 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNode.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNode.swift @@ -1254,6 +1254,8 @@ public final class ChatListNode: ListView { } else { var previousPinnedChats: [EnginePeer.Id] = [] var updatedPinnedChats: [EnginePeer.Id] = [] + var previousPinnedThreads: [Int64] = [] + var updatedPinnedThreads: [Int64] = [] var didIncludeRemovingPeerId = false var didIncludeHiddenByDefaultArchive = false @@ -1267,6 +1269,10 @@ public final class ChatListNode: ListView { if chatListIndex.messageIndex.id.peerId == removingPeerId { didIncludeRemovingPeerId = true } + } else if case let .forum(pinnedIndex, _, threadId, _, _) = index { + if case .index = pinnedIndex { + previousPinnedThreads.append(threadId) + } } } else if case let .GroupReferenceEntry(_, _, _, _, _, _, _, _, hiddenByDefault) = entry { didIncludeHiddenByDefaultArchive = hiddenByDefault @@ -1280,7 +1286,12 @@ public final class ChatListNode: ListView { if case let .PeerEntry(index, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) = entry { if case let .chatList(index) = index, index.pinningIndex != nil { updatedPinnedChats.append(index.messageIndex.id.peerId) + } else if case let .forum(pinnedIndex, _, threadId, _, _) = index { + if case .index = pinnedIndex { + updatedPinnedThreads.append(threadId) + } } + if case let .chatList(index) = index, index.messageIndex.id.peerId == removingPeerId { doesIncludeRemovingPeerId = true } @@ -1289,7 +1300,7 @@ public final class ChatListNode: ListView { doesIncludeHiddenByDefaultArchive = hiddenByDefault } } - if previousPinnedChats != updatedPinnedChats { + if previousPinnedChats != updatedPinnedChats || previousPinnedThreads != updatedPinnedThreads { disableAnimations = false } if previousState.selectedPeerIds != state.selectedPeerIds {