From 0423351f5d3f3151f0859aa7d916e7ecc9465644 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Fri, 30 Dec 2022 22:55:24 +0100 Subject: [PATCH] Fixed account title --- .../Account/Sources/Account/AccountDetailView.swift | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Packages/Account/Sources/Account/AccountDetailView.swift b/Packages/Account/Sources/Account/AccountDetailView.swift index 30a0a36a..351f7b05 100644 --- a/Packages/Account/Sources/Account/AccountDetailView.swift +++ b/Packages/Account/Sources/Account/AccountDetailView.swift @@ -94,11 +94,16 @@ public struct AccountDetailView: View { .edgesIgnoringSafeArea(.top) .navigationBarTitleDisplayMode(.inline) .toolbar { - ToolbarItem(placement: .principal) { - if scrollOffset < -200 { - currentAccount.account?.displayNameWithEmojis - } + ToolbarItem(placement: .principal) { + if scrollOffset < -200 { + switch viewModel.accountState { + case let .data(account): + account.displayNameWithEmojis.font(.headline) + default: + EmptyView() + } } + } } }