From 095d3e35512063a13aa2993f85fd5e339605cff6 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Thu, 11 Sep 2025 17:59:58 +0200 Subject: [PATCH] Fix avatar photo refresh --- .../Main/Settings/ViewModel/AccountProfileViewModel.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Linphone/UI/Main/Settings/ViewModel/AccountProfileViewModel.swift b/Linphone/UI/Main/Settings/ViewModel/AccountProfileViewModel.swift index 74dcfaa42..45063c751 100644 --- a/Linphone/UI/Main/Settings/ViewModel/AccountProfileViewModel.swift +++ b/Linphone/UI/Main/Settings/ViewModel/AccountProfileViewModel.swift @@ -132,9 +132,11 @@ class AccountProfileViewModel: ObservableObject { ContactsManager.shared.awaitDataWrite(data: data, name: name, prefix: prefix) { result in UserDefaults.standard.set(result, forKey: photoAvatarModelKey) - CoreContext.shared.accounts[self.accountModelIndex ?? 0].photoAvatarModel = "" - CoreContext.shared.accounts[self.accountModelIndex ?? 0].imagePathAvatar = nil - NotificationCenter.default.post(name: NSNotification.Name("ImageChanged"), object: nil) + DispatchQueue.main.async { + CoreContext.shared.accounts[self.accountModelIndex ?? 0].photoAvatarModel = "" + CoreContext.shared.accounts[self.accountModelIndex ?? 0].imagePathAvatar = nil + NotificationCenter.default.post(name: NSNotification.Name("ImageChanged"), object: nil) + } DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { CoreContext.shared.accounts[self.accountModelIndex ?? 0].photoAvatarModel = result