Skip to content

Commit

Permalink
[Feature/#343] 프로필 수정 완료 후 업데이트 처리 (#344)
Browse files Browse the repository at this point in the history
* feat: onProfileImageEditComplete 브릿지 추가

* feat: onProfileImageEditComplete 브릿지 호출 시 유저 정보 업데이트
  • Loading branch information
leemhyungyu authored Nov 7, 2024
1 parent 59e6243 commit 1fb142e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public enum BottleWebViewAction: Equatable {
case logOutButtonDidTapped
/// 회원탈퇴
case withdrawalButtonDidTap
/// 프로필 사진 수정 완료
case profileImageDidChanged

public init?(
type: String,
Expand Down Expand Up @@ -142,6 +144,9 @@ public enum BottleWebViewAction: Equatable {
case "deleteUser":
self = .withdrawalButtonDidTap

case "onProfileImageEditComplete":
self = .profileImageDidChanged

default:
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ extension EditProfileFeature {
case .backButtonDidTapped:
return .send(.delegate(.closeEditProfileView))

case .profileImageDidChanged:
return .send(.delegate(.profileImageDidChanged))

default:
return .none
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ public struct EditProfileFeature {
case presentToast(message: String)
case backButtonDidTapped
case delegate(Delegate)
case profileImageDidChanged

public enum Delegate {
case closeEditProfileView
case profileImageDidChanged
}

// binding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public struct ProfileEditView: View {
case .closeWebView:
store.send(.backButtonDidTapped)

case .profileImageDidChanged:
store.send(.profileImageDidChanged)

default:
Log.assertion(message: "\(action) - not handled action")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ extension MyPageRootFeature {
case .closeEditProfileView:
_ = state.path.popLast()
return .none
case .profileImageDidChanged:
return .send(.myPage(.userProfileUpdateDidRequest))
}

default:
Expand Down

0 comments on commit 1fb142e

Please sign in to comment.