Update defaultAccount on logout

This commit is contained in:
Benoit Martins 2025-07-10 11:59:47 +02:00
parent 737a9880b6
commit 4b87be84bd
2 changed files with 11 additions and 2 deletions

View file

@ -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)

View file

@ -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
}
}
}
}
)