Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-03-14 22:16:20 +04:00
parent b3e5ac68b0
commit 2178de9f8a
10 changed files with 44 additions and 17 deletions

View File

@@ -838,7 +838,7 @@ final class ChatEmptyNode: ASDisplayNode {
} else if let _ = interfaceState.peerNearbyData {
contentType = .peerNearby
} else if let peer = peer as? TelegramUser {
if peer.isDeleted || peer.botInfo != nil || peer.flags.contains(.isSupport) {
if peer.isDeleted || peer.botInfo != nil || peer.flags.contains(.isSupport) || peer.isScam || interfaceState.peerIsBlocked {
contentType = .regular
} else if case .clearedHistory = emptyType {
contentType = .regular
@@ -854,8 +854,12 @@ final class ChatEmptyNode: ASDisplayNode {
var contentTransition = transition
if self.content?.0 != contentType {
var animateContentIn = false
if let node = self.content?.1 {
node.removeFromSupernode()
if self.content?.0 != nil && contentType == .greeting && transition.isAnimated {
animateContentIn = true
}
}
let node: ASDisplayNode & ChatEmptyNodeContent
switch contentType {
@@ -875,6 +879,11 @@ final class ChatEmptyNode: ASDisplayNode {
self.content = (contentType, node)
self.addSubnode(node)
contentTransition = .immediate
if animateContentIn, case let .animated(duration, curve) = transition {
node.layer.animateAlpha(from: 0.0, to: 1.0, duration: duration)
node.layer.animateScale(from: 0.0, to: 1.0, duration: duration, timingFunction: curve.timingFunction)
}
}
self.isUserInteractionEnabled = [.peerNearby, .greeting].contains(contentType)