From 9e099d66124628ed33ed7ded87cd771e7e31adc2 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Sun, 31 Aug 2025 22:36:46 +0400 Subject: [PATCH] Various fixes --- .../ChatThemeScreen/Sources/ChatThemeScreen.swift | 8 -------- .../GiftViewScreen/Sources/GiftViewScreen.swift | 15 ++++++--------- .../Chat/ChatControllerThemeManagement.swift | 2 +- versions.json | 2 +- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift b/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift index b7cd11f010..23fe009606 100644 --- a/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift +++ b/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift @@ -975,11 +975,6 @@ 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), @@ -1033,9 +1028,6 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, ASScrollViewDelega )) var giftThemes = uniqueGiftChatThemesState.themes - if ignoreGiftThemes { - giftThemes = [] - } var existingIds = Set() if let initiallySelectedTheme, case .gift = initiallySelectedTheme { let initialThemeIndex = giftThemes.firstIndex(where: { $0.id == initiallySelectedTheme.id }) diff --git a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift index d23dbbed52..c56e3120ae 100644 --- a/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift +++ b/submodules/TelegramUI/Components/Gifts/GiftViewScreen/Sources/GiftViewScreen.swift @@ -826,7 +826,9 @@ private final class GiftViewSheetContent: CombinedComponent { peerController.peerSelected = { [weak peerController, weak navigationController] peer, _ in if let navigationController { let proceed = { - let _ = context.engine.themes.setChatTheme(peerId: peer.id, chatTheme: .gift(.unique(gift), [])).start() + let _ = context.engine.themes.setChatWallpaper(peerId: peer.id, wallpaper: nil, forBoth: true).startStandalone() + let _ = context.engine.themes.setChatTheme(peerId: peer.id, chatTheme: .gift(.unique(gift), [])).startStandalone() + peerController?.dismiss() context.sharedContext.navigateToChatController(NavigateToChatControllerParams( @@ -1210,13 +1212,8 @@ private final class GiftViewSheetContent: CombinedComponent { self?.shareGift() }))) - - 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 { + + if gift.flags.contains(.isThemeAvailable) { 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 @@ -4714,7 +4711,7 @@ public class GiftViewScreen: ViewControllerComponentContainer { self.view.disablesInteractiveModalDismiss = true - if let arguments = self.subject.arguments, let _ = self.subject.arguments?.resellAmounts { + if let arguments = self.subject.arguments, let resellAmounts = self.subject.arguments?.resellAmounts, !resellAmounts.isEmpty { if case let .unique(uniqueGift) = arguments.gift, case .peerId(self.context.account.peerId) = uniqueGift.owner { } else { self.showBalance = true diff --git a/submodules/TelegramUI/Sources/Chat/ChatControllerThemeManagement.swift b/submodules/TelegramUI/Sources/Chat/ChatControllerThemeManagement.swift index b51952d115..8006a42067 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatControllerThemeManagement.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatControllerThemeManagement.swift @@ -262,7 +262,7 @@ extension ChatControllerImpl { return } if canResetWallpaper && chatTheme != nil { - let _ = context.engine.themes.setChatWallpaper(peerId: peerId, wallpaper: nil, forBoth: false).startStandalone() + let _ = context.engine.themes.setChatWallpaper(peerId: peerId, wallpaper: nil, forBoth: true).startStandalone() } strongSelf.chatThemeAndDarkAppearancePreviewPromise.set(.single((chatTheme ?? .emoticon(""), nil))) let _ = context.engine.themes.setChatTheme(peerId: peerId, chatTheme: chatTheme ?? .emoticon("")).startStandalone(completed: { [weak self] in diff --git a/versions.json b/versions.json index 6c85ab5077..6b7e5549eb 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { - "app": "11.15", + "app": "12.0", "xcode": "16.2", "bazel": "8.3.1:0cac3a67dc5429c68272dc6944104952e9e4cf84b29d126a5ff3fbaa59045217", "macos": "15"