From 4b87be84bde4d08e4914dc4b73ed398cd34ed905 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Thu, 10 Jul 2025 11:59:47 +0200 Subject: [PATCH] Update defaultAccount on logout --- Linphone/UI/Main/ContentView.swift | 7 +++++-- .../Main/Settings/Fragments/AccountProfileFragment.swift | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Linphone/UI/Main/ContentView.swift b/Linphone/UI/Main/ContentView.swift index c350a78c2..c33812146 100644 --- a/Linphone/UI/Main/ContentView.swift +++ b/Linphone/UI/Main/ContentView.swift @@ -460,8 +460,11 @@ struct ContentView: View { cachedImage .resizable() .aspectRatio(contentMode: .fill) - .frame(width: avatarSize, height: avatarSize) - .clipShape(Circle()) + .frame(width: avatarSize, height: avatarSize) + .clipShape(Circle()) + .onTapGesture { + openMenu() + } } else { ProgressView() .frame(width: avatarSize, height: avatarSize) diff --git a/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift b/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift index 6f46cab52..3da79fbb4 100644 --- a/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift +++ b/Linphone/UI/Main/Settings/Fragments/AccountProfileFragment.swift @@ -641,6 +641,12 @@ struct AccountProfileFragment: View { actionSecondButton: { if accountProfileViewModel.accountModelIndex != nil { CoreContext.shared.accounts[accountProfileViewModel.accountModelIndex!].logout() + isShowAccountProfileFragment = false + if let firstAccount = CoreContext.shared.accounts.first?.account { + CoreContext.shared.doOnCoreQueue { core in + core.defaultAccount = firstAccount + } + } } } )