From c88e69ec29fd4860f81417b6238429044a1d6405 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Thu, 29 Feb 2024 16:30:02 +0400 Subject: [PATCH] Add NO TAG --- .../Sources/ChatListFilterPresetController.swift | 16 ++++++++++------ .../Sources/PeerNameColorItem.swift | 8 ++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/submodules/ChatListUI/Sources/ChatListFilterPresetController.swift b/submodules/ChatListUI/Sources/ChatListFilterPresetController.swift index 8e81920a02..368044f5b9 100644 --- a/submodules/ChatListUI/Sources/ChatListFilterPresetController.swift +++ b/submodules/ChatListUI/Sources/ChatListFilterPresetController.swift @@ -466,12 +466,16 @@ private enum ChatListFilterPresetEntry: ItemListNodeEntry { var badge: String? var badgeStyle: ItemListSectionHeaderItem.BadgeStyle? var accessoryText: ItemListSectionHeaderAccessoryText? - if isPremium, let color { - badge = name.uppercased() - badgeStyle = ItemListSectionHeaderItem.BadgeStyle( - background: color.main.withMultipliedAlpha(0.1), - foreground: color.main - ) + if isPremium { + if let color { + badge = name.uppercased() + badgeStyle = ItemListSectionHeaderItem.BadgeStyle( + background: color.main.withMultipliedAlpha(0.1), + foreground: color.main + ) + } else { + accessoryText = ItemListSectionHeaderAccessoryText(value: "NO TAG", color: .generic) + } } else if color != nil { accessoryText = ItemListSectionHeaderAccessoryText(value: "PREMIUM EXPIRED", color: .generic) } diff --git a/submodules/TelegramUI/Components/Settings/PeerNameColorItem/Sources/PeerNameColorItem.swift b/submodules/TelegramUI/Components/Settings/PeerNameColorItem/Sources/PeerNameColorItem.swift index f9dae2ab34..43c1869971 100644 --- a/submodules/TelegramUI/Components/Settings/PeerNameColorItem/Sources/PeerNameColorItem.swift +++ b/submodules/TelegramUI/Components/Settings/PeerNameColorItem/Sources/PeerNameColorItem.swift @@ -469,10 +469,6 @@ public final class PeerNameColorItemNode: ListViewItemNode, ItemListItemNode { var items: [PeerNameColorIconItem] = [] var i: Int = 0 - if item.displayEmptyColor { - items.append(PeerNameColorIconItem(index: nil, colors: nil, isDark: item.theme.overallDarkAppearance, selected: item.currentColor == nil, isLocked: item.isLocked, action: action)) - i += 1 - } for index in displayOrder { let color = PeerNameColor(rawValue: index) @@ -489,6 +485,10 @@ public final class PeerNameColorItemNode: ListViewItemNode, ItemListItemNode { items.append(PeerNameColorIconItem(index: color, colors: colors, isDark: item.theme.overallDarkAppearance, selected: color == item.currentColor, isLocked: item.isLocked, action: action)) i += 1 } + if item.displayEmptyColor { + items.append(PeerNameColorIconItem(index: nil, colors: nil, isDark: item.theme.overallDarkAppearance, selected: item.currentColor == nil, isLocked: item.isLocked, action: action)) + i += 1 + } strongSelf.items = items let sideInset: CGFloat = params.leftInset + 10.0