|
|
|
@ -55,7 +55,7 @@ struct UmpireView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if self._isConnected() { |
|
|
|
if StoreCenter.main.isAuthenticated { |
|
|
|
NavigationLink { |
|
|
|
NavigationLink { |
|
|
|
AccountView(user: dataStore.user) { } |
|
|
|
AccountView(user: dataStore.user) { } |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
@ -242,10 +242,6 @@ struct UmpireView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fileprivate func _isConnected() -> Bool { |
|
|
|
|
|
|
|
return dataStore.user.username.count > 0 && StoreCenter.main.hasToken() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct AccountRowView: View { |
|
|
|
struct AccountRowView: View { |
|
|
|
@ -254,9 +250,9 @@ struct AccountRowView: View { |
|
|
|
var userName: String |
|
|
|
var userName: String |
|
|
|
var body: some View { |
|
|
|
var body: some View { |
|
|
|
|
|
|
|
|
|
|
|
let hasToken = StoreCenter.main.hasToken() |
|
|
|
let isAuthenticated = StoreCenter.main.isAuthenticated |
|
|
|
LabeledContent { |
|
|
|
LabeledContent { |
|
|
|
if hasToken { |
|
|
|
if isAuthenticated { |
|
|
|
Text(self.userName) |
|
|
|
Text(self.userName) |
|
|
|
} else if StoreCenter.main.userName() != nil { |
|
|
|
} else if StoreCenter.main.userName() != nil { |
|
|
|
Image(systemName: "xmark.circle.fill") |
|
|
|
Image(systemName: "xmark.circle.fill") |
|
|
|
@ -264,7 +260,7 @@ struct AccountRowView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Label("Mon compte", systemImage: "person.fill") |
|
|
|
Label("Mon compte", systemImage: "person.fill") |
|
|
|
if hasToken && dataStore.user.email.isEmpty == false { |
|
|
|
if isAuthenticated && dataStore.user.email.isEmpty == false { |
|
|
|
Text(dataStore.user.email) |
|
|
|
Text(dataStore.user.email) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|