Login flow fixed
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user