Skip to content

Commit 1368fd3

Browse files
authored
Merge pull request #159 from TaskarCenterAtUW/feature-logout-modification
replace logout button and action with redirecting to profile screen
2 parents 8ca23fe + 5561583 commit 1368fd3

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

GoInfoGame/GoInfoGame/UI/InitialView/InitialView.swift

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct WorkspacesListView: View {
6464
@AppStorage("loggedIn") private var loggedIn: Bool = false
6565

6666
var body: some View {
67-
ZStack(alignment: .topTrailing) {
67+
ZStack(alignment: .topLeading) {
6868
VStack(alignment: .leading) {
6969
VStack(spacing: 30) {
7070
Image("osmlogo")
@@ -117,25 +117,17 @@ struct WorkspacesListView: View {
117117
}
118118
}
119119

120-
Button(action: {
121-
_ = KeychainManager.delete(key: "accessToken")
122-
_ = KeychainManager.delete(key: "username")
123-
loggedIn = false
124-
UserProfileCache.shared.clearUserProfile()
125-
126-
if let window = UIApplication.shared.windows.first {
127-
window.rootViewController = UIHostingController(rootView: PosmLoginView())
128-
}
129-
}) {
130-
Image(systemName: "rectangle.portrait.and.arrow.right")
131-
.font(.system(size: 15))
132-
.foregroundColor(.blue)
133-
.padding(8)
134-
.background(Color.white)
135-
.cornerRadius(8)
136-
.shadow(radius: 3)
137-
}
138-
.padding([.top, .trailing], 16)
120+
NavigationLink(destination: UserProfileView()) {
121+
Image(systemName: "person.crop.circle.fill")
122+
.resizable()
123+
.frame(width: 27, height: 27)
124+
.padding([.leading], 18)
125+
126+
}
127+
128+
129+
130+
139131
}
140132
}
141133
}

0 commit comments

Comments
 (0)