diff --git a/submodules/PremiumUI/Sources/GiveawayInfoController.swift b/submodules/PremiumUI/Sources/GiveawayInfoController.swift index 7254a63fe7..7719ac3f2e 100644 --- a/submodules/PremiumUI/Sources/GiveawayInfoController.swift +++ b/submodules/PremiumUI/Sources/GiveawayInfoController.swift @@ -10,7 +10,7 @@ import TelegramPresentationData import Markdown import AlertUI -public func giveawayInfoController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal)? = nil, message: EngineMessage, giveawayInfo: PremiumGiveawayInfo) -> ViewController? { +public func giveawayInfoController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal)? = nil, message: EngineMessage, giveawayInfo: PremiumGiveawayInfo, openLink: @escaping (String) -> Void) -> ViewController? { guard let giveaway = message.media.first(where: { $0 is TelegramMediaGiveaway }) as? TelegramMediaGiveaway else { return nil } @@ -138,9 +138,9 @@ public func giveawayInfoController(context: AccountContext, updatedPresentationD result = "\n\n" + presentationData.strings.Chat_Giveaway_Info_DidntWin case let .won(slug): result = "\n\n" + presentationData.strings.Chat_Giveaway_Info_Won("🏆").string - let _ = slug actions = [TextAlertAction(type: .defaultAction, title: presentationData.strings.Chat_Giveaway_Info_ViewPrize, action: { dismissImpl?() + openLink(slug) }), TextAlertAction(type: .genericAction, title: presentationData.strings.Common_Cancel, action: { dismissImpl?() })] diff --git a/submodules/PremiumUI/Sources/PremiumLimitScreen.swift b/submodules/PremiumUI/Sources/PremiumLimitScreen.swift index 1fd9ad03ff..0ecbf43532 100644 --- a/submodules/PremiumUI/Sources/PremiumLimitScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumLimitScreen.swift @@ -1176,18 +1176,18 @@ private final class LimitSheetContent: CombinedComponent { if let remaining { let storiesString = strings.ChannelBoost_StoriesPerDay(level + 1) let valueString = strings.ChannelBoost_MoreBoosts(remaining) - if level == 0 { - switch boostSubject { - case .stories: + switch boostSubject { + case .stories: + if level == 0 { titleText = strings.ChannelBoost_EnableStories string = strings.ChannelBoost_EnableStoriesText(valueString).string - case .nameColors: - titleText = strings.ChannelBoost_EnableColors - string = strings.ChannelBoost_EnableColorsText(valueString).string + } else { + titleText = strings.ChannelBoost_IncreaseLimit + string = strings.ChannelBoost_IncreaseLimitText(valueString, storiesString).string } - } else { - titleText = strings.ChannelBoost_IncreaseLimit - string = strings.ChannelBoost_IncreaseLimitText(valueString, storiesString).string + case .nameColors: + titleText = strings.ChannelBoost_EnableColors + string = strings.ChannelBoost_EnableColorsText(valueString).string } } else { let storiesString = strings.ChannelBoost_StoriesPerDay(level) diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 4c453a7ef9..2915acc7c3 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -19179,7 +19179,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G guard let self, let message else { return } - if let controller = giveawayInfoController(context: self.context, updatedPresentationData: self.updatedPresentationData, message: message, giveawayInfo: giveawayInfo) { + if let controller = giveawayInfoController(context: self.context, updatedPresentationData: self.updatedPresentationData, message: message, giveawayInfo: giveawayInfo, openLink: { [weak self] slug in + guard let self else { + return + } + self.openResolved(result: .premiumGiftCode(slug: slug), sourceMessageId: messageId) + }) { self.present(controller, in: .window(.root)) } })