From 212164b072dadbdee8ad46ce71f97e831faea64c Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 24 Jun 2025 01:46:25 +0200 Subject: [PATCH] Fix build --- .../PeerInfoScreen/Sources/PeerInfoData.swift | 15 --------------- .../Sources/PeerInfoScreen.swift | 10 ---------- .../Sources/StarsAvatarComponent.swift | 18 +++++++++++++++--- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoData.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoData.swift index 4a5d20f5fd..fe4168a2ef 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoData.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoData.swift @@ -381,7 +381,6 @@ final class PeerInfoScreenData { let hasBotPreviewItems: Bool let isPremiumRequiredForStoryPosting: Bool let personalChannel: PeerInfoPersonalChannelData? - let tonState: StarsContext.State? let starsState: StarsContext.State? let tonState: StarsContext.State? let starsRevenueStatsState: StarsRevenueStats? @@ -434,7 +433,6 @@ final class PeerInfoScreenData { hasBotPreviewItems: Bool, isPremiumRequiredForStoryPosting: Bool, personalChannel: PeerInfoPersonalChannelData?, - tonState: StarsContext.State?, starsState: StarsContext.State?, tonState: StarsContext.State?, starsRevenueStatsState: StarsRevenueStats?, @@ -475,7 +473,6 @@ final class PeerInfoScreenData { self.hasBotPreviewItems = hasBotPreviewItems self.isPremiumRequiredForStoryPosting = isPremiumRequiredForStoryPosting self.personalChannel = personalChannel - self.tonState = tonState self.starsState = starsState self.tonState = tonState self.starsRevenueStatsState = starsRevenueStatsState @@ -852,13 +849,6 @@ func peerInfoScreenSettingsData(context: AccountContext, peerId: EnginePeer.Id, } } - let tonState: Signal - if let tonContext { - tonState = tonContext.state - } else { - tonState = .single(nil) - } - let starsState: Signal if let starsContext { starsState = starsContext.state @@ -979,7 +969,6 @@ func peerInfoScreenSettingsData(context: AccountContext, peerId: EnginePeer.Id, hasBotPreviewItems: false, isPremiumRequiredForStoryPosting: true, personalChannel: personalChannel, - tonState: tonState, starsState: starsState, tonState: tonState, starsRevenueStatsState: nil, @@ -1031,7 +1020,6 @@ func peerInfoScreenData(context: AccountContext, peerId: PeerId, strings: Presen hasBotPreviewItems: false, isPremiumRequiredForStoryPosting: true, personalChannel: nil, - tonState: nil, starsState: nil, tonState: nil, starsRevenueStatsState: nil, @@ -1492,7 +1480,6 @@ func peerInfoScreenData(context: AccountContext, peerId: PeerId, strings: Presen hasBotPreviewItems: hasBotPreviewItems, isPremiumRequiredForStoryPosting: false, personalChannel: personalChannel, - tonState: nil, starsState: nil, tonState: nil, starsRevenueStatsState: starsRevenueContextAndState.1, @@ -1725,7 +1712,6 @@ func peerInfoScreenData(context: AccountContext, peerId: PeerId, strings: Presen hasBotPreviewItems: false, isPremiumRequiredForStoryPosting: isPremiumRequiredForStoryPosting, personalChannel: personalChannel, - tonState: nil, starsState: nil, tonState: nil, starsRevenueStatsState: starsRevenueContextAndState.1, @@ -2059,7 +2045,6 @@ func peerInfoScreenData(context: AccountContext, peerId: PeerId, strings: Presen hasBotPreviewItems: false, isPremiumRequiredForStoryPosting: isPremiumRequiredForStoryPosting, personalChannel: nil, - tonState: nil, starsState: nil, tonState: nil, starsRevenueStatsState: starsRevenueContextAndState.1, diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index cfde06c2ee..5826e05e63 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -10670,11 +10670,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro } case .ton: if let tonContext = self.controller?.tonContext { -<<<<<<< HEAD push(self.context.sharedContext.makeTonTransactionsScreen(context: self.context, tonContext: tonContext)) -======= - push(self.context.sharedContext.makeStarsTransactionsScreen(context: self.context, starsContext: tonContext)) ->>>>>>> 51a16c711078fab6940623bf1de0ec85516ba699 } } } @@ -12992,12 +12988,6 @@ public final class PeerInfoScreenImpl: ViewController, PeerInfoScreen, KeyShortc self.starsContext = nil self.tonContext = nil } - if isSettings, let tonContext = context.tonContext { - self.tonContext = tonContext - tonContext.load(force: true) - } else { - self.tonContext = nil - } if isMyProfile, let profileGiftsContext { profileGiftsContext.updateFilter(.All) diff --git a/submodules/TelegramUI/Components/Stars/StarsAvatarComponent/Sources/StarsAvatarComponent.swift b/submodules/TelegramUI/Components/Stars/StarsAvatarComponent/Sources/StarsAvatarComponent.swift index b372222740..0d53714a56 100644 --- a/submodules/TelegramUI/Components/Stars/StarsAvatarComponent/Sources/StarsAvatarComponent.swift +++ b/submodules/TelegramUI/Components/Stars/StarsAvatarComponent/Sources/StarsAvatarComponent.swift @@ -374,13 +374,19 @@ public final class StarsAvatarComponent: Component { public final class StarsLabelComponent: CombinedComponent { let text: NSAttributedString let subtext: NSAttributedString? + let iconName: String + let iconColor: UIColor? public init( text: NSAttributedString, - subtext: NSAttributedString? = nil + subtext: NSAttributedString? = nil, + iconName: String = "Premium/Stars/StarMedium", + iconColor: UIColor? = nil ) { self.text = text self.subtext = subtext + self.iconName = iconName + self.iconColor = iconColor } public static func ==(lhs: StarsLabelComponent, rhs: StarsLabelComponent) -> Bool { @@ -390,6 +396,12 @@ public final class StarsLabelComponent: CombinedComponent { if lhs.subtext != rhs.subtext { return false } + if lhs.iconName != rhs.iconName { + return false + } + if lhs.iconColor != rhs.iconColor { + return false + } return true } @@ -420,8 +432,8 @@ public final class StarsLabelComponent: CombinedComponent { let iconSize = CGSize(width: 20.0, height: 20.0) let icon = icon.update( component: BundleIconComponent( - name: "Premium/Stars/StarMedium", - tintColor: nil + name: component.iconName, + tintColor: component.iconColor ), availableSize: iconSize, transition: context.transition