From 1fb142ed6163b946e7ae4a1ba067fcee7edcfdf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=84=ED=98=84=EA=B7=9C?= <48830320+leemhyungyu@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:49:27 +0900 Subject: [PATCH] =?UTF-8?q?[Feature/#343]=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C=20=ED=9B=84=20=EC=97=85?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=8A=B8=20=EC=B2=98=EB=A6=AC=20(#344)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: onProfileImageEditComplete 브릿지 추가 * feat: onProfileImageEditComplete 브릿지 호출 시 유저 정보 업데이트 --- .../Core/WebView/Interface/Sources/BottleWebViewAction.swift | 5 +++++ .../Interface/Sources/EditProfile/EditProfileFeature.swift | 3 +++ .../Sources/EditProfile/EditProfileFeatureInterface.swift | 2 ++ .../Interface/Sources/EditProfile/ProfileEditView.swift | 3 +++ .../Interface/Sources/MyPageRootFeatureInterface.swift | 2 ++ 5 files changed, 15 insertions(+) diff --git a/Projects/Core/WebView/Interface/Sources/BottleWebViewAction.swift b/Projects/Core/WebView/Interface/Sources/BottleWebViewAction.swift index be67e664..eb555528 100644 --- a/Projects/Core/WebView/Interface/Sources/BottleWebViewAction.swift +++ b/Projects/Core/WebView/Interface/Sources/BottleWebViewAction.swift @@ -47,6 +47,8 @@ public enum BottleWebViewAction: Equatable { case logOutButtonDidTapped /// 회원탈퇴 case withdrawalButtonDidTap + /// 프로필 사진 수정 완료 + case profileImageDidChanged public init?( type: String, @@ -142,6 +144,9 @@ public enum BottleWebViewAction: Equatable { case "deleteUser": self = .withdrawalButtonDidTap + case "onProfileImageEditComplete": + self = .profileImageDidChanged + default: return nil } diff --git a/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeature.swift b/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeature.swift index e711cc73..85b53e11 100644 --- a/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeature.swift +++ b/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeature.swift @@ -28,6 +28,9 @@ extension EditProfileFeature { case .backButtonDidTapped: return .send(.delegate(.closeEditProfileView)) + case .profileImageDidChanged: + return .send(.delegate(.profileImageDidChanged)) + default: return .none } diff --git a/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeatureInterface.swift b/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeatureInterface.swift index 43b47e82..8198a418 100644 --- a/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeatureInterface.swift +++ b/Projects/Feature/MyPage/Interface/Sources/EditProfile/EditProfileFeatureInterface.swift @@ -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 diff --git a/Projects/Feature/MyPage/Interface/Sources/EditProfile/ProfileEditView.swift b/Projects/Feature/MyPage/Interface/Sources/EditProfile/ProfileEditView.swift index 7addfb6b..8bc811d0 100644 --- a/Projects/Feature/MyPage/Interface/Sources/EditProfile/ProfileEditView.swift +++ b/Projects/Feature/MyPage/Interface/Sources/EditProfile/ProfileEditView.swift @@ -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") } diff --git a/Projects/Feature/MyPage/Interface/Sources/MyPageRootFeatureInterface.swift b/Projects/Feature/MyPage/Interface/Sources/MyPageRootFeatureInterface.swift index a7d175b3..0be43eef 100644 --- a/Projects/Feature/MyPage/Interface/Sources/MyPageRootFeatureInterface.swift +++ b/Projects/Feature/MyPage/Interface/Sources/MyPageRootFeatureInterface.swift @@ -57,6 +57,8 @@ extension MyPageRootFeature { case .closeEditProfileView: _ = state.path.popLast() return .none + case .profileImageDidChanged: + return .send(.myPage(.userProfileUpdateDidRequest)) } default: