diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index d3e9ac1b55..c4790fbebb 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -772,7 +772,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { } self.avatarNode.setPeer(context: item.context, theme: item.presentationData.theme, peer: peer, overrideImage: overrideImage, emptyColor: item.presentationData.theme.list.mediaPlaceholderColor, synchronousLoad: synchronousLoads, displayDimensions: CGSize(width: 60.0, height: 60.0)) - if peer.isPremium { + if peer.isPremium && peer.id != item.context.account.peerId { let context = item.context self.cachedDataDisposable.set((context.account.postbox.peerView(id: peer.id) |> deliverOnMainQueue).start(next: { [weak self] peerView in diff --git a/submodules/PeerInfoUI/Sources/IncreaseLimitFooterItem.swift b/submodules/PeerInfoUI/Sources/IncreaseLimitFooterItem.swift index 7f2f4e7519..6ec922464f 100644 --- a/submodules/PeerInfoUI/Sources/IncreaseLimitFooterItem.swift +++ b/submodules/PeerInfoUI/Sources/IncreaseLimitFooterItem.swift @@ -84,7 +84,12 @@ final class IncreaseLimitFooterItemNode: ItemListControllerFooterItemNode { let icon: UIImage? if self.item.colorful { textColor = .white - backgroundColors = [UIColor(rgb: 0x407af0), UIColor(rgb: 0x9551e8), UIColor(rgb: 0xbf499a), UIColor(rgb: 0xf17b30)] + backgroundColors = [ + UIColor(rgb: 0x0077ff), + UIColor(rgb: 0x6b93ff), + UIColor(rgb: 0x8878ff), + UIColor(rgb: 0xe46ace) + ] icon = UIImage(bundleImageName: "Premium/X2") } else { textColor = self.item.theme.list.itemCheckColors.foregroundColor diff --git a/submodules/PeerInfoUI/Sources/IncreaseLimitHeaderItem.swift b/submodules/PeerInfoUI/Sources/IncreaseLimitHeaderItem.swift index 97ef96afc5..e0bb7bfddc 100644 --- a/submodules/PeerInfoUI/Sources/IncreaseLimitHeaderItem.swift +++ b/submodules/PeerInfoUI/Sources/IncreaseLimitHeaderItem.swift @@ -154,7 +154,7 @@ class IncreaseLimitHeaderItemNode: ListViewItemNode { ], inactiveTitle: item.strings.Premium_Free, inactiveValue: "", - inactiveTitleColor: .black, + inactiveTitleColor: item.theme.list.itemPrimaryTextColor, activeTitle: item.strings.Premium_Premium, activeValue: "\(item.premiumCount)", activeTitleColor: .white, diff --git a/submodules/PeerInfoUI/Sources/OldChannelsController.swift b/submodules/PeerInfoUI/Sources/OldChannelsController.swift index 62c0af2558..e110b16f25 100644 --- a/submodules/PeerInfoUI/Sources/OldChannelsController.swift +++ b/submodules/PeerInfoUI/Sources/OldChannelsController.swift @@ -322,14 +322,19 @@ public func oldChannelsController(context: AccountContext, updatedPresentationDa buttonText = presentationData.strings.Premium_IncreaseLimit colorful = true } - let footerItem = IncreaseLimitFooterItem(theme: presentationData.theme, title: buttonText, colorful: colorful, action: { - if state.selectedPeers.count > 0 { - leaveActionImpl?() - } else { - let controller = PremiumIntroScreen(context: context, source: .groupsAndChannels) - pushImpl?(controller) - } - }) + let footerItem: IncreaseLimitFooterItem? + if state.isSearching && state.selectedPeers.count == 0 { + footerItem = nil + } else { + footerItem = IncreaseLimitFooterItem(theme: presentationData.theme, title: buttonText, colorful: colorful, action: { + if state.selectedPeers.count > 0 { + leaveActionImpl?() + } else { + let controller = PremiumIntroScreen(context: context, source: .groupsAndChannels) + pushImpl?(controller) + } + }) + } let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: oldChannelsEntries(presentationData: presentationData, state: state, limit: limits.maxChannelsCount, premiumLimit: premiumLimits.maxChannelsCount, peers: peers, intent: intent), style: .blocks, emptyStateItem: emptyStateItem, searchItem: searchItem, footerItem: footerItem, initialScrollToItem: ListViewScrollToItem(index: 0, position: .top(-navigationBarSearchContentHeight), animated: false, curve: .Default(duration: 0.0), directionHint: .Up), crossfadeState: peersAreEmptyUpdated, animateChanges: false) @@ -353,7 +358,7 @@ public func oldChannelsController(context: AccountContext, updatedPresentationDa let ensureStoredPeersSignal: Signal = context.engine.peers.ensurePeersAreLocallyAvailable(peers: ensureStoredPeers.map(EnginePeer.init)) return ensureStoredPeersSignal - |> then(context.engine.peers.removePeerChats(peerIds: Array(peers.map(\.peer.id)))) + |> then(context.engine.peers.removePeerChats(peerIds: Array(ensureStoredPeers.map(\.id)))) } |> deliverOnMainQueue).start(completed: { completed(true) diff --git a/submodules/PremiumUI/Sources/PremiumLimitScreen.swift b/submodules/PremiumUI/Sources/PremiumLimitScreen.swift index 3374572468..365424302e 100644 --- a/submodules/PremiumUI/Sources/PremiumLimitScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumLimitScreen.swift @@ -202,7 +202,9 @@ private class PremiumLimitAnimationComponent: Component { rotateAnimation.timingFunction = CAMediaTimingFunction(name: .easeOut) Queue.mainQueue().after(0.5, { - self.hapticFeedback.impact(.light) + if !self.badgeView.isHidden { + self.hapticFeedback.impact(.light) + } }) let returnAnimation = CABasicAnimation(keyPath: "transform.rotation.z") @@ -736,7 +738,7 @@ private final class LimitSheetContent: CombinedComponent { } else { badgePosition = CGFloat(component.count) / CGFloat(premiumLimit) } - buttonIconName = "Premium/AddOne" + buttonIconName = "Premium/PlusOne" } var reachedMaximumLimit = badgePosition >= 1.0 if case .folders = subject, !state.isPremium { diff --git a/submodules/PremiumUI/Sources/PremiumLimitsListScreen.swift b/submodules/PremiumUI/Sources/PremiumLimitsListScreen.swift index 7d66e69a07..1fc010dbea 100644 --- a/submodules/PremiumUI/Sources/PremiumLimitsListScreen.swift +++ b/submodules/PremiumUI/Sources/PremiumLimitsListScreen.swift @@ -242,27 +242,27 @@ private enum Limit: CaseIterable { } } - func limit(_ configuration: EngineConfiguration.UserLimits) -> String { + func limit(_ configuration: EngineConfiguration.UserLimits, isPremium: Bool) -> String { let value: Int32 switch self { case .groups: value = configuration.maxChannelsCount case .pins: - value = configuration.maxPinnedChatCount + value = configuration.maxPinnedChatCount case .publicLinks: - value = configuration.maxPublicLinksCount + value = configuration.maxPublicLinksCount case .savedGifs: - value = configuration.maxSavedGifCount + value = configuration.maxSavedGifCount case .favedStickers: - value = configuration.maxFavedStickerCount + value = configuration.maxFavedStickerCount case .captions: - value = configuration.maxCaptionLength + value = configuration.maxCaptionLength case .folders: - value = configuration.maxFoldersCount + value = configuration.maxFoldersCount case .chatsPerFolder: - value = configuration.maxFolderChatsCount + value = configuration.maxFolderChatsCount case .account: - value = 3 + value = isPremium ? 4 : 3 } return "\(value)" } @@ -355,11 +355,11 @@ private final class PremimLimitsListScreenComponent: CombinedComponent { inactiveColor: theme.list.itemBlocksSeparatorColor.withAlphaComponent(0.5), inactiveTextColor: theme.list.itemPrimaryTextColor, inactiveTitle: strings.Premium_Free, - inactiveValue: value.limit(state.limits), + inactiveValue: value.limit(state.limits, isPremium: false), activeColor: colors[index], activeTextColor: .white, activeTitle: strings.Premium_Premium, - activeValue: value.limit(state.premiumLimits) + activeValue: value.limit(state.premiumLimits, isPremium: true) ) ) )