Various fixes

This commit is contained in:
Ilya Laktyushin
2022-06-11 11:49:36 +04:00
parent 6d68d52542
commit a4c6e96b66
9 changed files with 121 additions and 63 deletions

View File

@@ -1161,7 +1161,6 @@ private final class PremiumIntroScreenContentComponent: CombinedComponent {
})
let termsString: MultilineTextComponent.TextContent
// if context.component.isPremium == true {
if let promoConfiguration = context.state.promoConfiguration {
let attributedString = stringWithAppliedEntities(promoConfiguration.status, entities: promoConfiguration.statusEntities, baseColor: termsTextColor, linkColor: environment.theme.list.itemAccentColor, baseFont: termsFont, linkFont: termsFont, boldFont: boldTermsFont, italicFont: italicTermsFont, boldItalicFont: boldItalicTermsFont, fixedFont: monospaceTermsFont, blockQuoteFont: termsFont)
termsString = .plain(attributedString)
@@ -1390,6 +1389,13 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
return
}
guard !self.context.account.testingEnvironment else {
let presentationData = self.context.sharedContext.currentPresentationData.with { $0 }
let alertController = textAlertController(context: self.context, title: nil, text: "Telegram Premium purchase is not available in the test environment.", actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})])
self.present(alertController)
return
}
addAppLogEvent(postbox: self.context.account.postbox, type: "premium.promo_screen_accept")
self.inProgress = true