forked from mirrors/linphone-iphone
Reduced conversation list refresh to once, triggered after fetching all contacts
This commit is contained in:
parent
34ff5bcf16
commit
e74df76301
4 changed files with 2 additions and 12 deletions
|
|
@ -89,7 +89,6 @@ final class ContactsManager: ObservableObject {
|
|||
}
|
||||
|
||||
let store = CNContactStore()
|
||||
|
||||
store.requestAccess(for: .contacts) { (granted, error) in
|
||||
if let error = error {
|
||||
print("\(#function) - failed to request access", error)
|
||||
|
|
@ -162,10 +161,10 @@ final class ContactsManager: ObservableObject {
|
|||
DispatchQueue.main.async {
|
||||
self.avatarListModel += addedAvatarListModel
|
||||
}
|
||||
|
||||
MagicSearchSingleton.shared.searchForContacts(sourceFlags: MagicSearch.Source.Friends.rawValue | MagicSearch.Source.LdapServers.rawValue)
|
||||
})
|
||||
self.friendList?.addDelegate(delegate: self.friendListDelegate!)
|
||||
|
||||
MagicSearchSingleton.shared.searchForContacts(sourceFlags: MagicSearch.Source.Friends.rawValue | MagicSearch.Source.LdapServers.rawValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1340,9 +1340,6 @@ struct ContentView: View {
|
|||
.zIndex(6)
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
MagicSearchSingleton.shared.searchForContacts(sourceFlags: MagicSearch.Source.Friends.rawValue | MagicSearch.Source.LdapServers.rawValue)
|
||||
}
|
||||
.onChange(of: navigationManager.selectedCallId) { newCallId in
|
||||
if newCallId != nil {
|
||||
self.index = 2
|
||||
|
|
|
|||
|
|
@ -69,11 +69,6 @@ struct ConversationsListFragment: View {
|
|||
.padding(.all)
|
||||
)
|
||||
}
|
||||
.onChange(of: scenePhase) { newPhase in
|
||||
if newPhase == .active {
|
||||
conversationsListViewModel.computeChatRoomsList(filter: "")
|
||||
}
|
||||
}
|
||||
.navigationTitle("")
|
||||
.navigationBarHidden(true)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ class ConversationsListViewModel: ObservableObject {
|
|||
var selectedConversation: ConversationModel?
|
||||
|
||||
init() {
|
||||
computeChatRoomsList(filter: "")
|
||||
addConversationDelegate()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue