Skip to content

Commit 83f6068

Browse files
author
Isaac
committed
Merge commit 'e3ed629d8f3a081a0861d1359b5b26575aa911a5'
2 parents bd79779 + e3ed629 commit 83f6068

File tree

4 files changed

+45
-30
lines changed

4 files changed

+45
-30
lines changed

Telegram/Telegram-iOS/en.lproj/Localizable.strings

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14762,3 +14762,14 @@ Sorry for the inconvenience.";
1476214762
"FaceScan.Instruction.Rotate" = "Move your head slowly to\ncomplete the circle";
1476314763

1476414764
"Gift.Buy.Confirm.BuyForTon" = "Buy for %@ TON";
14765+
14766+
"Gift.View.DisplayedInfoNew" = "This gift is visible. [Hide from Profile >]()";
14767+
"Gift.View.HiddenInfoNew" = "This gift is hidden. [Show on Profile >]()";
14768+
14769+
"Gift.View.DisplayedInfoChannelNew" = "This gift is visible. [Hide from Profile >]()";
14770+
"Gift.View.HiddenInfoChannelNew" = "This gift is hidden. [Show on Profile >]()";
14771+
14772+
"Gift.View.Upgrade" = "Upgrade";
14773+
14774+
"Gift.View.UpgradeDescription" = "Upgrade this gift to turn it to a unique collectible.";
14775+
"Gift.View.UpgradeFreeDescription" = "Upgrade this gift for free to turn it to a unique collectible.";

submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,7 +2239,11 @@ private final class GiftViewSheetContent: CombinedComponent {
22392239
} else if let convertStars, !upgraded {
22402240
if !converted {
22412241
if canUpgrade || upgradeStars != nil {
2242-
descriptionText = isChannelGift ? strings.Gift_View_KeepUpgradeOrConvertDescription_Channel(strings.Gift_View_KeepOrConvertDescription_Stars(Int32(convertStars))).string : strings.Gift_View_KeepUpgradeOrConvertDescription(strings.Gift_View_KeepOrConvertDescription_Stars(Int32(convertStars))).string
2242+
if let upgradeStars, upgradeStars > 0 {
2243+
descriptionText = strings.Gift_View_UpgradeFreeDescription
2244+
} else {
2245+
descriptionText = strings.Gift_View_UpgradeDescription
2246+
}
22432247
} else {
22442248
descriptionText = isChannelGift ? strings.Gift_View_KeepOrConvertDescription_Channel(strings.Gift_View_KeepOrConvertDescription_Stars(Int32(convertStars))).string : strings.Gift_View_KeepOrConvertDescription(strings.Gift_View_KeepOrConvertDescription_Stars(Int32(convertStars))).string
22452249
}
@@ -3047,6 +3051,17 @@ private final class GiftViewSheetContent: CombinedComponent {
30473051
canConvert = false
30483052
}
30493053
}
3054+
3055+
if canConvert, let date = subject.arguments?.date {
3056+
let configuration = GiftConfiguration.with(appConfiguration: component.context.currentAppConfiguration.with { $0 })
3057+
let starsConvertMaxDate = date + configuration.convertToStarsPeriod
3058+
3059+
let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970)
3060+
if currentTime > starsConvertMaxDate {
3061+
canConvert = false
3062+
}
3063+
}
3064+
30503065
if let convertStars, incoming && !converted && canConvert {
30513066
tableItems.append(.init(
30523067
id: "value_convert",
@@ -3121,23 +3136,6 @@ private final class GiftViewSheetContent: CombinedComponent {
31213136
component: AnyComponent(MultilineTextComponent(text: .plain(NSAttributedString(string: strings.Gift_View_Status_NonUnique, font: tableFont, textColor: tableTextColor))))
31223137
)
31233138
)
3124-
if incoming {
3125-
items.append(
3126-
AnyComponentWithIdentity(
3127-
id: AnyHashable(1),
3128-
component: AnyComponent(Button(
3129-
content: AnyComponent(ButtonContentComponent(
3130-
context: component.context,
3131-
text: strings.Gift_View_Status_Upgrade,
3132-
color: theme.list.itemAccentColor
3133-
)),
3134-
action: { [weak state] in
3135-
state?.requestUpgradePreview()
3136-
}
3137-
))
3138-
)
3139-
)
3140-
}
31413139
tableItems.append(.init(
31423140
id: "status",
31433141
title: strings.Gift_View_Status,
@@ -3241,15 +3239,11 @@ private final class GiftViewSheetContent: CombinedComponent {
32413239
} else if let uniqueGift, let address = uniqueGift.giftAddress, case .address = uniqueGift.owner {
32423240
addressToOpen = address
32433241
descriptionText = strings.Gift_View_TonGiftAddressInfo
3244-
} else if savedToProfile {
3245-
descriptionText = isChannelGift ? strings.Gift_View_DisplayedInfoHide_Channel : strings.Gift_View_DisplayedInfoHide
3246-
} else if let upgradeStars, upgradeStars > 0 && !upgraded {
3247-
descriptionText = isChannelGift ? strings.Gift_View_HiddenInfoShow_Channel : strings.Gift_View_HiddenInfoShow
32483242
} else {
3249-
if let _ = uniqueGift {
3250-
descriptionText = isChannelGift ? strings.Gift_View_UniqueHiddenInfo_Channel : strings.Gift_View_UniqueHiddenInfo
3243+
if isChannelGift {
3244+
descriptionText = savedToProfile ? strings.Gift_View_DisplayedInfoChannelNew : strings.Gift_View_HiddenInfoChannelNew
32513245
} else {
3252-
descriptionText = isChannelGift ? strings.Gift_View_HiddenInfo_Channel : strings.Gift_View_HiddenInfo
3246+
descriptionText = savedToProfile ? strings.Gift_View_DisplayedInfoNew : strings.Gift_View_HiddenInfoNew
32533247
}
32543248
}
32553249

@@ -3484,13 +3478,18 @@ private final class GiftViewSheetContent: CombinedComponent {
34843478
availableSize: buttonSize,
34853479
transition: context.transition
34863480
)
3487-
} else if incoming && !converted && !upgraded, let upgradeStars, upgradeStars > 0 {
3488-
let buttonTitle = strings.Gift_View_UpgradeForFree
3481+
} else if incoming && !converted && !upgraded {
3482+
let buttonTitle: String
3483+
if let upgradeStars, upgradeStars > 0 {
3484+
buttonTitle = strings.Gift_View_UpgradeForFree
3485+
} else {
3486+
buttonTitle = strings.Gift_View_Upgrade
3487+
}
34893488
buttonChild = button.update(
34903489
component: ButtonComponent(
34913490
background: buttonBackground.withIsShimmering(true),
34923491
content: AnyComponentWithIdentity(
3493-
id: AnyHashable("freeUpgrade"),
3492+
id: AnyHashable("previewUpgrade"),
34943493
component: AnyComponent(HStack([
34953494
AnyComponentWithIdentity(id: 0, component: AnyComponent(
34963495
MultilineTextComponent(text: .plain(NSAttributedString(string: buttonTitle, font: Font.semibold(17.0), textColor: theme.list.itemCheckColors.foregroundColor, paragraphAlignment: .center))

submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr
618618
context: self.context,
619619
colors: TabSelectorComponent.Colors(
620620
foreground: params.presentationData.theme.list.itemSecondaryTextColor,
621-
selection: params.presentationData.theme.list.itemPrimaryTextColor.withMultipliedAlpha(0.05),
621+
selection: params.presentationData.theme.list.itemSecondaryTextColor.withMultipliedAlpha(0.15),
622622
simple: true
623623
),
624624
theme: params.presentationData.theme,

submodules/TelegramUI/Components/Stars/StarsTransactionScreen/Sources/StarsTransactionScreen.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,13 @@ private final class StarsTransactionSheetContent: CombinedComponent {
927927
title = count.amount < StarsAmount.zero || countIsGeneric ? strings.Stars_Transaction_To : strings.Stars_Transaction_From
928928
}
929929

930+
var isGiftResale = false
931+
if count.amount < StarsAmount.zero, case let .transaction(transaction, _) = subject, transaction.flags.contains(.isStarGiftResale) {
932+
isGiftResale = true
933+
}
934+
930935
let toComponent: AnyComponent<Empty>
931-
if let _ = giftAnimationSubject, !toPeer.isDeleted && !isGiftUpgrade {
936+
if let _ = giftAnimationSubject, !toPeer.isDeleted && !isGiftUpgrade && !isGiftResale {
932937
toComponent = AnyComponent(
933938
HStack([
934939
AnyComponentWithIdentity(

0 commit comments

Comments
 (0)