mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Fix avatar display in conversation list
This commit is contained in:
parent
fcaedf8c02
commit
d17a9bbe4c
2 changed files with 4 additions and 21 deletions
|
|
@ -118,23 +118,6 @@ class ConversationsListViewModel: ObservableObject {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else if !conversationModel.isGroup {
|
||||
if let address = conversationModel.participantsAddress.first {
|
||||
let avatarModelTmp = ContactsManager.shared.avatarListModel.first(where: {
|
||||
guard let friend = $0.friend else { return false }
|
||||
return friend.name == conversationModel.subject &&
|
||||
friend.address?.asStringUriOnly() == address
|
||||
}) ?? ContactAvatarModel(
|
||||
friend: nil,
|
||||
name: conversationModel.subject,
|
||||
address: address,
|
||||
withPresence: false
|
||||
)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
conversationModel.avatarModel = avatarModelTmp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@ struct Avatar: View {
|
|||
}
|
||||
|
||||
var body: some View {
|
||||
if let photoPath = contactAvatarModel.friend?.photo {
|
||||
let uniqueUrl = ContactsManager.shared.getImagePath(friendPhotoPath: photoPath)
|
||||
let finalUrl = uniqueUrl.appendingQueryItem("v", value: UUID().uuidString)
|
||||
if !contactAvatarModel.photo.isEmpty {
|
||||
let uniqueUrl = ContactsManager.shared.getImagePath(friendPhotoPath: contactAvatarModel.photo)
|
||||
//let finalUrl = uniqueUrl.appendingQueryItem("v", value: UUID().uuidString)
|
||||
|
||||
AsyncImage(url: finalUrl) { image in
|
||||
AsyncImage(url: uniqueUrl) { image in
|
||||
switch image {
|
||||
case .empty:
|
||||
ProgressView()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue