Login flow fixed

This commit is contained in:
Daniel Arantes Loverde
2026-02-05 16:57:27 -03:00
parent 01c1da0430
commit 51d02f6715
12 changed files with 859 additions and 108 deletions

View File

@@ -4,6 +4,7 @@ struct ProfileView: View {
@Binding var root: RootFlow
@Binding var selectedTab: MainTab
let tokenStore: TokenStore
@Binding var appState: AppState
var body: some View {
VStack(spacing: 20) {
@@ -29,6 +30,8 @@ struct ProfileView: View {
SecondaryButton(title: "Sair") {
tokenStore.clear()
appState.session.isAuthenticated = false
appState.session.jwt = nil
root = .auth
}
.padding(.horizontal, 20)
@@ -49,11 +52,11 @@ struct ProfileView: View {
.foregroundStyle(AppColors.textInverse)
)
Text("Daniel Loverde")
Text(appState.profile.name.isEmpty ? "Daniel Loverde" : appState.profile.name)
.font(AppTypography.heading2)
.foregroundStyle(AppColors.textPrimary)
Text("daniel@pedifoods.com.br")
Text(appState.profile.email.isEmpty ? "daniel@pedifoods.com.br" : appState.profile.email)
.font(.caption)
.foregroundStyle(AppColors.secondary)
}