Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-08-29 13:27:02 +03:00
parent 8f5ba80cd3
commit ccd30832cc
8 changed files with 88 additions and 18 deletions

View File

@@ -696,8 +696,15 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD
strongSelf.contextSourceNode.contentNode.addSubnode(updatedForwardBackgroundNode)
}
} else if let forwardBackgroundNode = strongSelf.forwardBackgroundNode {
forwardBackgroundNode.removeFromSupernode()
strongSelf.forwardBackgroundNode = nil
if animation.isAnimated {
strongSelf.forwardBackgroundNode = nil
forwardBackgroundNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.1, removeOnCompletion: false, completion: { [weak forwardBackgroundNode] _ in
forwardBackgroundNode?.removeFromSupernode()
})
} else {
forwardBackgroundNode.removeFromSupernode()
strongSelf.forwardBackgroundNode = nil
}
}
if let (forwardInfoSize, forwardInfoApply) = forwardInfoSizeApply {
@@ -718,8 +725,17 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD
strongSelf.forwardBackgroundNode?.frame = forwardBackgroundFrame
strongSelf.forwardBackgroundNode?.update(size: forwardBackgroundFrame.size, cornerRadius: 8.0, transition: .immediate)
} else if let forwardInfoNode = strongSelf.forwardInfoNode {
forwardInfoNode.removeFromSupernode()
strongSelf.forwardInfoNode = nil
if animation.isAnimated {
if let forwardInfoNode = strongSelf.forwardInfoNode {
strongSelf.forwardInfoNode = nil
forwardInfoNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.1, removeOnCompletion: false, completion: { [weak forwardInfoNode] _ in
forwardInfoNode?.removeFromSupernode()
})
}
} else {
forwardInfoNode.removeFromSupernode()
strongSelf.forwardInfoNode = nil
}
}
if let actionButtonsSizeAndApply = actionButtonsSizeAndApply {