Fix reporting video avatar

This commit is contained in:
Ilya Laktyushin 2021-03-17 16:00:46 +04:00
parent efaffc6459
commit 30a8e5eda6

View File

@ -2773,18 +2773,18 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
}
} else {
screenData = peerInfoScreenData(context: context, peerId: peerId, strings: self.presentationData.strings, dateTimeFormat: self.presentationData.dateTimeFormat, isSettings: self.isSettings, ignoreGroupInCommon: ignoreGroupInCommon)
var currentIsVideo = false
let item = self.headerNode.avatarListNode.listContainerNode.currentItemNode?.item
if let item = item, case let .image(image) = item {
currentIsVideo = !image.2.isEmpty
}
self.headerNode.displayAvatarContextMenu = { [weak self] node, gesture in
guard let strongSelf = self, let peer = strongSelf.data?.peer else {
return
}
var currentIsVideo = false
let item = strongSelf.headerNode.avatarListNode.listContainerNode.currentItemNode?.item
if let item = item, case let .image(image) = item {
currentIsVideo = !image.2.isEmpty
}
let items: [ContextMenuItem] = [
.action(ContextMenuActionItem(text: currentIsVideo ? strongSelf.presentationData.strings.PeerInfo_ReportProfileVideo : strongSelf.presentationData.strings.PeerInfo_ReportProfilePhoto, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Report"), color: theme.actionSheet.primaryTextColor)