Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-12-29 02:16:15 +04:00
parent 857122fe72
commit d43415d4fd
13 changed files with 158 additions and 78 deletions

View File

@@ -96,7 +96,6 @@ private enum ContactListNodeEntryId: Hashable {
private final class ContactListNodeInteraction {
fileprivate let activateSearch: () -> Void
fileprivate let openSortMenu: () -> Void
fileprivate let authorize: () -> Void
fileprivate let suppressWarning: () -> Void
fileprivate let openPeer: (ContactListPeer, ContactListAction) -> Void
@@ -104,9 +103,8 @@ private final class ContactListNodeInteraction {
let itemHighlighting = ContactItemHighlighting()
init(activateSearch: @escaping () -> Void, openSortMenu: @escaping () -> Void, authorize: @escaping () -> Void, suppressWarning: @escaping () -> Void, openPeer: @escaping (ContactListPeer, ContactListAction) -> Void, contextAction: ((EnginePeer, ASDisplayNode, ContextGesture?) -> Void)?) {
init(activateSearch: @escaping () -> Void, authorize: @escaping () -> Void, suppressWarning: @escaping () -> Void, openPeer: @escaping (ContactListPeer, ContactListAction) -> Void, contextAction: ((EnginePeer, ASDisplayNode, ContextGesture?) -> Void)?) {
self.activateSearch = activateSearch
self.openSortMenu = openSortMenu
self.authorize = authorize
self.suppressWarning = suppressWarning
self.openPeer = openPeer
@@ -162,7 +160,6 @@ private enum ContactListNodeEntry: Comparable, Identifiable {
text = strings.Contacts_SortedByPresence
}
return ContactListActionItem(presentationData: ItemListPresentationData(presentationData), title: text, icon: .inline(dropDownIcon, .right), highlight: .alpha, accessible: false, header: nil, action: {
interaction.openSortMenu()
})
case let .permissionInfo(_, title, text, suppressed):
return InfoListItem(presentationData: ItemListPresentationData(presentationData), title: title, text: .plain(text), style: .plain, closeAction: suppressed ? nil : {
@@ -442,11 +439,7 @@ private func contactListNodeEntries(accountPeer: EnginePeer?, peers: [ContactLis
var commonHeader: ListViewItemHeader?
var orderedPeers: [ContactListPeer]
var headers: [ContactListPeerId: ContactListNameIndexHeader] = [:]
if displaySortOptions, let sortOrder = presentation.sortOrder {
entries.append(.sort(theme, strings, sortOrder))
}
var addHeader = false
if #available(iOSApplicationExtension 10.0, iOS 10.0, *) {
let (suppressed, syncDisabled) = warningSuppressed
@@ -867,7 +860,6 @@ public final class ContactListNode: ASDisplayNode {
public var contentScrollingEnded: ((ListView) -> Bool)?
public var activateSearch: (() -> Void)?
public var openSortMenu: (() -> Void)?
public var openPeer: ((ContactListPeer, ContactListAction) -> Void)?
public var openPrivacyPolicy: (() -> Void)?
public var suppressPermissionWarning: (() -> Void)?
@@ -955,8 +947,6 @@ public final class ContactListNode: ASDisplayNode {
let interaction = ContactListNodeInteraction(activateSearch: { [weak self] in
self?.activateSearch?()
}, openSortMenu: { [weak self] in
self?.openSortMenu?()
}, authorize: {
authorizeImpl?()
}, suppressWarning: { [weak self] in