From 2120d4251feecc4ff363fec2aa5b85df325f2673 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 17 Jul 2020 15:28:38 +0300 Subject: [PATCH] Video avatar fixes --- submodules/GalleryUI/Sources/GalleryPagerNode.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/submodules/GalleryUI/Sources/GalleryPagerNode.swift b/submodules/GalleryUI/Sources/GalleryPagerNode.swift index be4e797c59..0572293e78 100644 --- a/submodules/GalleryUI/Sources/GalleryPagerNode.swift +++ b/submodules/GalleryUI/Sources/GalleryPagerNode.swift @@ -346,6 +346,12 @@ public final class GalleryPagerNode: ASDisplayNode, UIScrollViewDelegate, UIGest if self.updateOnReplacement { self.items = items + + for i in 0 ..< self.items.count { + if let itemNode = self.visibleItemNode(at: i) { + self.items[i].updateNode(node: itemNode, synchronous: synchronous) + } + } } } @@ -357,7 +363,7 @@ public final class GalleryPagerNode: ASDisplayNode, UIScrollViewDelegate, UIGest updatedItem.item.updateNode(node: itemNode, synchronous: transaction.synchronous) } } - + if !transaction.deleteItems.isEmpty || !transaction.insertItems.isEmpty { let deleteItems = transaction.deleteItems.sorted()