Various fixes

This commit is contained in:
Ilya Laktyushin
2025-03-13 15:31:01 +04:00
parent 6d1732d830
commit c6718b3a5e
3 changed files with 13 additions and 6 deletions

View File

@@ -218,8 +218,16 @@ private final class WebAppLaunchConfirmationAlertContentNode: AlertContentNode {
let titleSize = self.titleNode.updateLayout(CGSize(width: size.width - 32.0, height: size.height))
var totalWidth = titleSize.width
if self.peer.isVerified {
let statusContent: EmojiStatusComponent.Content = .verified(fillColor: self.presentationTheme.list.itemCheckColors.fillColor, foregroundColor: self.presentationTheme.list.itemCheckColors.foregroundColor, sizeType: .large)
var statusContent: EmojiStatusComponent.Content?
if self.peer.isScam {
statusContent = .text(color: self.presentationTheme.list.itemDestructiveColor, string: self.strings.Message_ScamAccount.uppercased())
} else if self.peer.isFake {
statusContent = .text(color: self.presentationTheme.list.itemDestructiveColor, string: self.strings.Message_FakeAccount.uppercased())
} else if self.peer.isVerified {
statusContent = .verified(fillColor: self.presentationTheme.list.itemCheckColors.fillColor, foregroundColor: self.presentationTheme.list.itemCheckColors.foregroundColor, sizeType: .large)
}
if let statusContent {
let titleCredibilityIconTransition: ComponentTransition = .immediate
let titleCredibilityIconView: ComponentHostView<Empty>
@@ -247,7 +255,6 @@ private final class WebAppLaunchConfirmationAlertContentNode: AlertContentNode {
)
totalWidth += titleIconSize.width + 2.0
titleCredibilityIconTransition.setFrame(view: titleCredibilityIconView, frame: CGRect(origin: CGPoint(x:floorToScreenPixels((size.width - totalWidth) / 2.0) + titleSize.width + 2.0, y: origin.y), size: titleIconSize))
}