mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix premium demo button when no option selected
This commit is contained in:
parent
9faa387d05
commit
d046176912
@ -416,11 +416,19 @@ private final class PremiumGiftScreenContentComponent: CombinedComponent {
|
|||||||
demoSubject = .translation
|
demoSubject = .translation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let buttonText: String
|
||||||
|
if let price = state?.price {
|
||||||
|
buttonText = strings.Premium_Gift_GiftSubscription(price).string
|
||||||
|
} else {
|
||||||
|
buttonText = strings.Common_OK
|
||||||
|
}
|
||||||
var dismissImpl: (() -> Void)?
|
var dismissImpl: (() -> Void)?
|
||||||
let controller = PremiumLimitsListScreen(context: accountContext, subject: demoSubject, source: .gift(state?.price), order: state?.configuration.perks, buttonText: strings.Premium_Gift_GiftSubscription(state?.price ?? "–").string, isPremium: false)
|
let controller = PremiumLimitsListScreen(context: accountContext, subject: demoSubject, source: .gift(state?.price), order: state?.configuration.perks, buttonText: buttonText, isPremium: false)
|
||||||
controller.action = {
|
controller.action = { [weak state] in
|
||||||
dismissImpl?()
|
dismissImpl?()
|
||||||
buy()
|
if let _ = state?.price {
|
||||||
|
buy()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
controller.disposed = {
|
controller.disposed = {
|
||||||
// updateIsFocused(false)
|
// updateIsFocused(false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user