Various improvements

This commit is contained in:
Ilya Laktyushin 2025-11-15 02:33:37 +04:00
parent a443df81dd
commit 29fb65d33d
2 changed files with 20 additions and 8 deletions

View file

@ -1599,11 +1599,13 @@ private final class GiftAuctionBidScreenComponent: Component {
controller?.present(
UndoOverlayController(
presentationData: presentationData,
content: .actionSucceeded(
content: .universalImage(
image: generateTintedImage(image: UIImage(bundleImageName: "Premium/Auction/BidMedium"), color: .white)!,
size: nil,
title: title,
text: text,
cancel: nil,
destructive: false
customUndoText: nil,
timeout: nil
),
position: .bottom,
action: { _ in return true }

View file

@ -3345,12 +3345,22 @@ private final class GiftViewSheetContent: CombinedComponent {
let hiddenDescription: String
if incoming {
hiddenDescription = text != nil ? strings.Gift_View_NameAndMessageHidden : strings.Gift_View_NameHidden
} else if let peerId = subject.arguments?.peerId, let peer = state.peerMap[peerId], subject.arguments?.fromPeerId != nil {
var peerName = peer.compactDisplayTitle
if peerName.count > 30 {
peerName = "\(peerName.prefix(30))"
} else if subject.arguments?.fromPeerId != nil {
var recipientPeerId: EnginePeer.Id?
if let toPeerId = subject.arguments?.auctionToPeerId {
recipientPeerId = toPeerId
} else if let peerId = subject.arguments?.peerId {
recipientPeerId = peerId
}
if let recipientPeerId, let peer = state.peerMap[recipientPeerId] {
var peerName = peer.compactDisplayTitle
if peerName.count > 30 {
peerName = "\(peerName.prefix(30))"
}
hiddenDescription = text != nil ? strings.Gift_View_Outgoing_NameAndMessageHidden(peerName).string : strings.Gift_View_Outgoing_NameHidden(peerName).string
} else {
hiddenDescription = ""
}
hiddenDescription = text != nil ? strings.Gift_View_Outgoing_NameAndMessageHidden(peerName).string : strings.Gift_View_Outgoing_NameHidden(peerName).string
} else {
hiddenDescription = ""
}