diff --git a/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift b/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift index 202d5d05ab..23fe009606 100644 --- a/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift +++ b/submodules/TelegramUI/Components/ChatThemeScreen/Sources/ChatThemeScreen.swift @@ -35,8 +35,8 @@ private struct ThemeSettingsThemeEntry: Comparable, Identifiable { let strings: PresentationStrings let wallpaper: TelegramWallpaper? - var stableId: Int { - return index + var stableId: String { + return self.chatTheme?.id ?? "\(self.index)" } static func ==(lhs: ThemeSettingsThemeEntry, rhs: ThemeSettingsThemeEntry) -> Bool { @@ -524,11 +524,13 @@ private final class ThemeSettingsThemeItemIconNode : ListViewItemNode { if let theme = item.chatTheme, case let .gift(_, themeSettings) = theme { if item.nightMode { if let theme = themeSettings.first(where: { $0.baseTheme == .night || $0.baseTheme == .tinted }) { - bubbleColor = UIColor(rgb: UInt32(bitPattern: theme.accentColor)) + let color = theme.wallpaper?.settings?.colors.first ?? theme.accentColor + bubbleColor = UIColor(rgb: UInt32(bitPattern: color)) } } else { if let theme = themeSettings.first(where: { $0.baseTheme == .classic || $0.baseTheme == .day }) { - bubbleColor = UIColor(rgb: UInt32(bitPattern: theme.accentColor)) + let color = theme.wallpaper?.settings?.colors.first ?? theme.accentColor + bubbleColor = UIColor(rgb: UInt32(bitPattern: color)) } } } @@ -964,7 +966,6 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, ASScrollViewDelega self.cancelButtonNode.buttonNode.addTarget(self, action: #selector(self.cancelButtonPressed), forControlEvents: .touchUpInside) self.doneButton.pressed = { [weak self] in if let strongSelf = self { - strongSelf.doneButton.isUserInteractionEnabled = false if strongSelf.doneButton.font == .bold { strongSelf.complete() } else { @@ -1349,6 +1350,7 @@ private class ChatThemeScreenNode: ViewControllerTracingNode, ASScrollViewDelega func complete() { let proceed = { + self.doneButton.isUserInteractionEnabled = false self.completion?(self.selectedTheme) } if case let .gift(gift, _) = self.selectedTheme, case let .unique(uniqueGift) = gift, let themePeerId = uniqueGift.themePeerId { diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/GiftsListView.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/GiftsListView.swift index 3c5f060d1c..4412a7ea4a 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/GiftsListView.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/GiftsListView.swift @@ -996,7 +996,7 @@ final class GiftsListView: UIView { fadeTransition.setAlpha(view: self.emptyResultsClippingView, alpha: visibleHeight < 300.0 ? 0.0 : 1.0) - if self.peerId == self.context.account.peerId, !self.canSelect && !self.filteredResultsAreEmpty && self.profileGifts.collectionId == nil { + if self.peerId == self.context.account.peerId, !self.canSelect && !self.filteredResultsAreEmpty && self.profileGifts.collectionId == nil && self.emptyResultsClippingView.isHidden { let footerText: ComponentView if let current = self.footerText { footerText = current @@ -1024,6 +1024,13 @@ final class GiftsListView: UIView { transition.setFrame(view: view, frame: CGRect(origin: CGPoint(x: floor((size.width - footerTextSize.width) / 2.0), y: contentHeight), size: footerTextSize)) } contentHeight += footerTextSize.height + } else if let footerText = self.footerText { + self.footerText = nil + if let view = footerText.view { + fadeTransition.setAlpha(view: view, alpha: 0.0, completion: { _ in + view.removeFromSuperview() + }) + } } return contentHeight diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift index b24eaa07c4..35ebc2693d 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoVisualMediaPaneNode/Sources/PeerInfoGiftsPaneNode.swift @@ -90,7 +90,6 @@ public final class PeerInfoGiftsPaneNode: ASDisplayNode, PeerInfoPaneNode, UIScr private let tabSelector = ComponentView() public private(set) var currentCollection: GiftCollection = .all - private var footerText: ComponentView? private var panelBackground: NavigationBackgroundNode? private var panelSeparator: ASDisplayNode? private var panelButton: ComponentView?