Various fixes

This commit is contained in:
Ilya Laktyushin
2025-03-08 00:01:18 +04:00
parent c39ba69250
commit a9ce88255d
9 changed files with 224 additions and 106 deletions

View File

@@ -322,7 +322,7 @@ private func selectivePrivacyPeersControllerEntries(presentationData: Presentati
return entries
}
public func selectivePrivacyPeersController(context: AccountContext, title: String, footer: String? = nil, initialPeers: [EnginePeer.Id: SelectivePrivacyPeer], initialEnableForPremium: Bool, displayPremiumCategory: Bool, initialEnableForBots: Bool, displayBotsCategory: Bool, updated: @escaping ([EnginePeer.Id: SelectivePrivacyPeer], Bool, Bool) -> Void) -> ViewController {
public func selectivePrivacyPeersController(context: AccountContext, title: String, footer: String? = nil, hideContacts: Bool = false, initialPeers: [EnginePeer.Id: SelectivePrivacyPeer], initialEnableForPremium: Bool, displayPremiumCategory: Bool, initialEnableForBots: Bool, displayBotsCategory: Bool, updated: @escaping ([EnginePeer.Id: SelectivePrivacyPeer], Bool, Bool) -> Void) -> ViewController {
let initialState = SelectivePrivacyPeersControllerState(enableForPremium: initialEnableForPremium, enableForBots: initialEnableForBots, editing: false, peerIdWithRevealedOptions: nil)
let statePromise = ValuePromise(initialState, ignoreRepeated: true)
let stateValue = Atomic(value: initialState)
@@ -428,7 +428,8 @@ public func selectivePrivacyPeersController(context: AccountContext, title: Stri
chatListFilters: nil,
onlyUsers: false,
disableChannels: true,
disableBots: false
disableBots: hideContacts,
disableContacts: hideContacts
)), alwaysEnabled: true))
addPeerDisposable.set((controller.result
|> take(1)