diff --git a/submodules/GalleryUI/Sources/GalleryControllerNode.swift b/submodules/GalleryUI/Sources/GalleryControllerNode.swift index 48ca1b5f83..5393185f88 100644 --- a/submodules/GalleryUI/Sources/GalleryControllerNode.swift +++ b/submodules/GalleryUI/Sources/GalleryControllerNode.swift @@ -228,15 +228,19 @@ open class GalleryControllerNode: ASDisplayNode, ASScrollViewDelegate, ASGesture fromLeft = true } if let current = strongSelf.currentThumbnailContainerNode { + strongSelf.currentThumbnailContainerNode = nil if thumbnailContainerVisible { current.animateOut(toRight: fromLeft) current.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak current] _ in current?.removeFromSupernode() }) + if let (navigationHeight, layout) = strongSelf.containerLayout, node == nil { + strongSelf.containerLayoutUpdated(layout, navigationBarHeight: navigationHeight, transition: .immediate) + } } } - strongSelf.currentThumbnailContainerNode = node if let node = node { + strongSelf.currentThumbnailContainerNode = node strongSelf.insertSubnode(node, aboveSubnode: strongSelf.footerNode) if let (navigationHeight, layout) = strongSelf.containerLayout, thumbnailContainerVisible { strongSelf.containerLayoutUpdated(layout, navigationBarHeight: navigationHeight, transition: .immediate) diff --git a/submodules/GalleryUI/Sources/GalleryFooterNode.swift b/submodules/GalleryUI/Sources/GalleryFooterNode.swift index 9c37116d6d..673c4e5a31 100644 --- a/submodules/GalleryUI/Sources/GalleryFooterNode.swift +++ b/submodules/GalleryUI/Sources/GalleryFooterNode.swift @@ -54,6 +54,8 @@ public final class GalleryFooterNode: ASDisplayNode { } self.addSubnode(footerContentNode) } + } else if let _ = self.currentThumbnailPanelHeight { + self.currentThumbnailPanelHeight = thumbnailPanelHeight } var animateOverlayIn = false