Various fixes

This commit is contained in:
Ilya Laktyushin 2025-08-21 16:01:12 +04:00
parent ed2b41a1a1
commit 8abcfbd895
2 changed files with 5 additions and 7 deletions

View File

@ -22,6 +22,7 @@ import PremiumCoinComponent
import Markdown import Markdown
import CountrySelectionUI import CountrySelectionUI
import AccountContext import AccountContext
import AlertUI
final class AuthorizationSequencePaymentScreenComponent: Component { final class AuthorizationSequencePaymentScreenComponent: Component {
typealias EnvironmentType = ViewControllerComponentContainer.Environment typealias EnvironmentType = ViewControllerComponentContainer.Environment
@ -142,12 +143,9 @@ final class AuthorizationSequencePaymentScreenComponent: Component {
} }
if let errorText { if let errorText {
//addAppLogEvent(postbox: component.engine.account.postbox, type: "premium_gift.promo_screen_fail") 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: {})])
let _ = errorText controller.present(alertController, in: .window(.root))
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))
} }
})) }))
} else { } else {

View File

@ -632,7 +632,7 @@ public final class TabSelectorComponent: Component {
} }
let estimatedContentWidth = 2.0 * spacing + innerContentWidth + (CGFloat(component.items.count - 1) * (spacing + innerInset)) 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 spacing = (availableSize.width - innerContentWidth) / CGFloat(component.items.count + 1) - innerInset * 2.0
} else if estimatedContentWidth > availableSize.width && !allowScroll { } else if estimatedContentWidth > availableSize.width && !allowScroll {
spacing = (availableSize.width - innerContentWidth) / CGFloat(component.items.count + 1) spacing = (availableSize.width - innerContentWidth) / CGFloat(component.items.count + 1)