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()
|
let store = CNContactStore()
|
||||||
|
|
||||||
store.requestAccess(for: .contacts) { (granted, error) in
|
store.requestAccess(for: .contacts) { (granted, error) in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
print("\(#function) - failed to request access", error)
|
print("\(#function) - failed to request access", error)
|
||||||
|
|
@ -162,10 +161,10 @@ final class ContactsManager: ObservableObject {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.avatarListModel += addedAvatarListModel
|
self.avatarListModel += addedAvatarListModel
|
||||||
}
|
}
|
||||||
|
|
||||||
MagicSearchSingleton.shared.searchForContacts(sourceFlags: MagicSearch.Source.Friends.rawValue | MagicSearch.Source.LdapServers.rawValue)
|
|
||||||
})
|
})
|
||||||
self.friendList?.addDelegate(delegate: self.friendListDelegate!)
|
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)
|
.zIndex(6)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onAppear {
|
|
||||||
MagicSearchSingleton.shared.searchForContacts(sourceFlags: MagicSearch.Source.Friends.rawValue | MagicSearch.Source.LdapServers.rawValue)
|
|
||||||
}
|
|
||||||
.onChange(of: navigationManager.selectedCallId) { newCallId in
|
.onChange(of: navigationManager.selectedCallId) { newCallId in
|
||||||
if newCallId != nil {
|
if newCallId != nil {
|
||||||
self.index = 2
|
self.index = 2
|
||||||
|
|
|
||||||
|
|
@ -69,11 +69,6 @@ struct ConversationsListFragment: View {
|
||||||
.padding(.all)
|
.padding(.all)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.onChange(of: scenePhase) { newPhase in
|
|
||||||
if newPhase == .active {
|
|
||||||
conversationsListViewModel.computeChatRoomsList(filter: "")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.navigationTitle("")
|
.navigationTitle("")
|
||||||
.navigationBarHidden(true)
|
.navigationBarHidden(true)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ class ConversationsListViewModel: ObservableObject {
|
||||||
var selectedConversation: ConversationModel?
|
var selectedConversation: ConversationModel?
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
computeChatRoomsList(filter: "")
|
|
||||||
addConversationDelegate()
|
addConversationDelegate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue