Various improvements

This commit is contained in:
Ilya Laktyushin 2025-08-28 05:22:22 +04:00
parent a4ed31da74
commit eac655f572
3 changed files with 14 additions and 2 deletions

View File

@ -975,6 +975,11 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, ASScrollViewDelega
}
self.otherButton.addTarget(self, action: #selector(self.otherButtonPressed), forControlEvents: .touchUpInside)
var ignoreGiftThemes = false
if let data = self.context.currentAppConfiguration.with({ $0 }).data, let _ = data["ios_killswitch_disable_gift_themes"] {
ignoreGiftThemes = true
}
self.disposable.set(combineLatest(
queue: Queue.mainQueue(),
self.context.engine.themes.getChatThemes(accountManager: self.context.sharedContext.accountManager),
@ -1028,6 +1033,9 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, ASScrollViewDelega
))
var giftThemes = uniqueGiftChatThemesState.themes
if ignoreGiftThemes {
giftThemes = []
}
var existingIds = Set<String>()
if let initiallySelectedTheme, case .gift = initiallySelectedTheme {
let initialThemeIndex = giftThemes.firstIndex(where: { $0.id == initiallySelectedTheme.id })

View File

@ -1171,7 +1171,12 @@ private final class GiftViewSheetContent: CombinedComponent {
self?.shareGift()
})))
if gift.flags.contains(.isThemeAvailable) {
var ignoreGiftThemes = false
if let data = self.context.currentAppConfiguration.with({ $0 }).data, let _ = data["ios_killswitch_disable_gift_themes"] {
ignoreGiftThemes = true
}
if gift.flags.contains(.isThemeAvailable) && !ignoreGiftThemes {
items.append(.action(ContextMenuActionItem(text: presentationData.strings.Gift_View_Context_SetAsTheme, icon: { theme in
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/ApplyTheme"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] c, _ in

View File

@ -673,7 +673,6 @@ final class StarsTransactionsScreenComponent: Component {
let withdrawAvailable = (self.revenueState?.balances.overallRevenue.amount.value ?? 0) > 0
if component.starsContext.ton {
//TODO:localize
let proceedsSize = self.proceedsView.update(
transition: .immediate,
component: AnyComponent(ListSectionComponent(