From b1bcf52a09d4a2359ca7e69ac28a92e8e2261b78 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 1 Sep 2025 13:14:37 +0400 Subject: [PATCH] Various fixes --- .../Telegram-iOS/en.lproj/Localizable.strings | 4 ++ .../Sources/PeerInfoHeaderNode.swift | 2 +- .../Sources/ProfileLevelInfoScreen.swift | 46 ++++++++++++++----- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 59dee5c2d8..66be514ea9 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -15004,3 +15004,7 @@ Sorry for the inconvenience."; "Notification.PrepaidGiftUpgrade" = "Gift Upgrade for %@"; "Notification.PrepaidGiftUpgrade.Stars_1" = "%@ Star"; "Notification.PrepaidGiftUpgrade.Stars_any" = "%@ Stars"; + +"ProfileLevelInfo.RatingTitle" = "Rating"; +"ProfileLevelInfo.FutureRatingTitle" = "Future Rating"; + diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift index 59df90ccd2..d38cf5f67f 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift @@ -589,7 +589,7 @@ final class PeerInfoHeaderNode: ASDisplayNode { } var currentSavedMusic: TelegramMediaFile? - if !self.isSettings, let screenData { + if let peer, peer.id != self.context.account.peerId || self.isMyProfile, let screenData { if let savedMusicState = screenData.savedMusicState { currentSavedMusic = savedMusicState.files.first } else if let cachedUserData = screenData.cachedData as? CachedUserData { diff --git a/submodules/TelegramUI/Components/PeerInfo/ProfileLevelInfoScreen/Sources/ProfileLevelInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/ProfileLevelInfoScreen/Sources/ProfileLevelInfoScreen.swift index fd2a593c0f..992c109dfd 100644 --- a/submodules/TelegramUI/Components/PeerInfo/ProfileLevelInfoScreen/Sources/ProfileLevelInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/ProfileLevelInfoScreen/Sources/ProfileLevelInfoScreen.swift @@ -377,24 +377,46 @@ private final class ProfileLevelInfoScreenComponent: Component { descriptionTextString = environment.strings.ProfileLevelInfo_OtherDescription(component.peer.compactDisplayTitle).string } - //TODO:localize var titleItems: [AnimatedTextComponent.Item] = [] + + let ratingTitle = environment.strings.ProfileLevelInfo_RatingTitle + let futureTitle = environment.strings.ProfileLevelInfo_FutureRatingTitle + if self.isPreviewingPendingRating { - titleItems.append(AnimatedTextComponent.Item( - id: AnyHashable(0), - isUnbreakable: false, - content: .text("Future ") - )) - titleItems.append(AnimatedTextComponent.Item( - id: AnyHashable(1), - isUnbreakable: true, - content: .text("Rating") - )) + if let range = futureTitle.range(of: ratingTitle) { + if !futureTitle[..