From fcd7dce58e7c087b39fbd97f58b6c264613fe56c Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 14 Jul 2020 20:19:45 +0300 Subject: [PATCH] Video avatar fixes --- submodules/LegacyComponents/Sources/TGPhotoTextEntityView.m | 4 +--- .../TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/submodules/LegacyComponents/Sources/TGPhotoTextEntityView.m b/submodules/LegacyComponents/Sources/TGPhotoTextEntityView.m index 9460d11871..c6f1895ed1 100644 --- a/submodules/LegacyComponents/Sources/TGPhotoTextEntityView.m +++ b/submodules/LegacyComponents/Sources/TGPhotoTextEntityView.m @@ -666,9 +666,7 @@ const CGFloat TGPhotoTextSelectionViewHandleSide = 30.0f; [self.path appendPath:[UIBezierPath bezierPathWithRoundedRect:cur cornerRadius:_radius]]; if (i == 0) { last = cur; - - //&& fabs(CGRectGetMaxY(last) - CGRectGetMinY(cur)) < 10.0 - } else if (i > 0) { + } else if (i > 0 && fabs(CGRectGetMaxY(last) - CGRectGetMinY(cur)) < 10.0) { CGPoint a = cur.origin; CGPoint b = CGPointMake(CGRectGetMaxX(cur), cur.origin.y); CGPoint c = CGPointMake(last.origin.x, CGRectGetMaxY(last)); diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift index 0a33ca38a6..c7b30e739a 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift @@ -209,6 +209,12 @@ final class PeerInfoAvatarListItemNode: ASDisplayNode { if self.isCentral { self.setupVideoPlayback() } else { + if let videoNode = self.videoNode { + self.videoNode = nil + Queue.mainQueue().after(0.5) { + videoNode.removeFromSupernode() + } + } // self.preloadDisposable.set(preloadVideoResource(postbox: self.context.account.postbox, resourceReference: )) } }