From 8abcfbd8959f3d9646918b8a350f1c029c2766a7 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 21 Aug 2025 16:01:12 +0400 Subject: [PATCH] Various fixes --- .../Sources/AuthorizationSequencePaymentScreen.swift | 10 ++++------ .../Sources/TabSelectorComponent.swift | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift index 963e68e5ab..8310c8f980 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequencePaymentScreen.swift @@ -22,6 +22,7 @@ import PremiumCoinComponent import Markdown import CountrySelectionUI import AccountContext +import AlertUI final class AuthorizationSequencePaymentScreenComponent: Component { typealias EnvironmentType = ViewControllerComponentContainer.Environment @@ -142,12 +143,9 @@ final class AuthorizationSequencePaymentScreenComponent: Component { } if let errorText { - //addAppLogEvent(postbox: component.engine.account.postbox, type: "premium_gift.promo_screen_fail") - - let _ = errorText - let _ = controller - //let alertController = textAlertController(context: component.context, title: nil, text: errorText, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]) - //controller.present(alertController, in: .window(.root)) + let theme = AlertControllerTheme(presentationData: presentationData) + let alertController = textAlertController(alertContext: AlertControllerContext(theme: theme, themeSignal: .single(theme)), title: nil, text: errorText, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]) + controller.present(alertController, in: .window(.root)) } })) } else { diff --git a/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift b/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift index f6bfb5ca17..5725b96903 100644 --- a/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift +++ b/submodules/TelegramUI/Components/TabSelectorComponent/Sources/TabSelectorComponent.swift @@ -632,7 +632,7 @@ public final class TabSelectorComponent: Component { } let estimatedContentWidth = 2.0 * spacing + innerContentWidth + (CGFloat(component.items.count - 1) * (spacing + innerInset)) - if component.customLayout?.fillWidth == true && estimatedContentWidth < availableSize.width { + if component.customLayout?.fillWidth == true && estimatedContentWidth < availableSize.width && component.items.count > 1 { spacing = (availableSize.width - innerContentWidth) / CGFloat(component.items.count + 1) - innerInset * 2.0 } else if estimatedContentWidth > availableSize.width && !allowScroll { spacing = (availableSize.width - innerContentWidth) / CGFloat(component.items.count + 1)