Skip to content

Commit

Permalink
feat(core): profile username
Browse files Browse the repository at this point in the history
  • Loading branch information
tomokisun committed Sep 15, 2024
1 parent 70a65cb commit ec60262
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Packages/MatchCore/Sources/ProfileLogic/Profile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,20 @@ public struct ProfileLogic {
await openURL(url)
}

case .destination(.presented(.confirmationDialog(.editUsername))):
guard let username = state.currentUser?.berealUsername
else { return .none }
case .destination(.presented(.confirmationDialog(.editUsername))):
let username = switch environment.brand() {
case .bematch:
""
assertionFailure("not supported by bematch")
case .picmatch:
state.currentUser?.instagramUsername ?? ""
case .tapmatch:
state.currentUser?.tapnowUsername ?? ""
case .tenmatch:
state.currentUser?.tentenPinCode ?? ""
case .trinket:
state.currentUser?.locketUrl ?? ""
}

state.destination = .editUsername(UsernameSettingLogic.State(username: username))
return .none
Expand Down

0 comments on commit ec60262

Please sign in to comment.