diff --git a/IceCubesApp/App/AppAccounts/AppAccountsManager.swift b/IceCubesApp/App/AppAccounts/AppAccountsManager.swift index fceed968..4f92ce0c 100644 --- a/IceCubesApp/App/AppAccounts/AppAccountsManager.swift +++ b/IceCubesApp/App/AppAccounts/AppAccountsManager.swift @@ -8,18 +8,18 @@ class AppAccountsManager: ObservableObject { oauthToken: currentAccount.oauthToken) } } - @Published var availableAccount: [AppAccount] + @Published var availableAccounts: [AppAccount] @Published var currentClient: Client init() { var defaultAccount = AppAccount(server: IceCubesApp.defaultServer, oauthToken: nil) do { let keychainAccounts = try AppAccount.retrieveAll() - availableAccount = keychainAccounts + availableAccounts = keychainAccounts defaultAccount = keychainAccounts.last ?? defaultAccount } catch {} currentAccount = defaultAccount - availableAccount = [defaultAccount] + availableAccounts = [defaultAccount] currentClient = .init(server: defaultAccount.server, oauthToken: defaultAccount.oauthToken) } diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index 58dbf721..38fa95c7 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -21,7 +21,7 @@ struct SettingsTabs: View { NavigationStack { Form { appSection - accountSection + accountsSection themeSection instanceSection } @@ -43,16 +43,19 @@ struct SettingsTabs: View { } } - private var accountSection: some View { + private var accountsSection: some View { Section("Account") { if let accountData = currentAccount.account { - VStack(alignment: .leading) { - Text(appAccountsManager.currentAccount.server) - .font(.headline) - Text(accountData.displayName) - Text(accountData.username) - .font(.footnote) - .foregroundColor(.gray) + HStack { + AvatarView(url: accountData.avatar) + VStack(alignment: .leading) { + Text(appAccountsManager.currentAccount.server) + .font(.headline) + Text(accountData.displayName) + Text(accountData.username) + .font(.footnote) + .foregroundColor(.gray) + } } signOutButton } else {