Skip to content

Commit 0e37850

Browse files
committed
Add to user profile edit button auth check
1 parent d8f4fcd commit 0e37850

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Modules/Sources/ProfileFeature/ProfileScreen.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,15 @@ public struct ProfileScreen: View {
109109
}
110110
}
111111

112-
ToolbarItem {
113-
Button {
114-
send(.editButtonTapped)
115-
} label: {
116-
Image(systemSymbol: .pencil)
112+
if let userId = store.userId,
113+
let userSession = store.userSession,
114+
userSession.userId == userId {
115+
ToolbarItem {
116+
Button {
117+
send(.editButtonTapped)
118+
} label: {
119+
Image(systemSymbol: .pencil)
120+
}
117121
}
118122
}
119123
}

0 commit comments

Comments
 (0)