diff --git a/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupFeature.swift b/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupFeature.swift index d78eda3b..c11477a4 100644 --- a/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupFeature.swift +++ b/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupFeature.swift @@ -34,6 +34,14 @@ public struct IntroductionSetupFeature { // Web Bridge case closeWebView case presentToastDidRequired(message: String) + case introductionDidCompleted + + // Delegate + case delegate(Delegate) + + public enum Delegate { + case introductionDidCompleted + } } public var body: some ReducerOf { @@ -55,9 +63,15 @@ extension IntroductionSetupFeature { await dismiss() } + case .introductionDidCompleted: + return .send(.delegate(.introductionDidCompleted)) + case let .presentToastDidRequired(message): toastClient.presentToast(message: message) return .none + + default: + return .none } } self.init(reducer: reducer) diff --git a/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupView.swift b/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupView.swift index 78600e75..9e1f4f93 100644 --- a/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupView.swift +++ b/Projects/Feature/ProfileSetup/Interface/Sources/IntroductionSetup/IntroductionSetupView.swift @@ -34,7 +34,7 @@ public struct IntroductionSetupView: View { store.send(.closeWebView) case .introductionDidCompleted: - store.send(.closeWebView) + store.send(.introductionDidCompleted) case let .showTaost(message): store.send(.presentToastDidRequired(message: message)) diff --git a/Projects/Feature/SandBeach/Interface/Sources/Root/SandBeachRootFeature.swift b/Projects/Feature/SandBeach/Interface/Sources/Root/SandBeachRootFeature.swift index 3008787f..414127bb 100644 --- a/Projects/Feature/SandBeach/Interface/Sources/Root/SandBeachRootFeature.swift +++ b/Projects/Feature/SandBeach/Interface/Sources/Root/SandBeachRootFeature.swift @@ -159,6 +159,12 @@ extension SandBeachRootFeature { return .none } + // IntroductionSetup Delegate + case let .path(.element(id: _, action: .IntroductionSetup(.delegate(delegate)))): + switch delegate { + case .introductionDidCompleted: + return .send(.profileSetupDidCompleted) + } // BottleArrivalDetail Delegate case let .path(.element(id: _, action: .BottleArrivalDetail(.delegate(delegate)))): switch delegate { diff --git a/Projects/Feature/SandBeach/Interface/Sources/SandBeach/SandBeachFeatureInterface.swift b/Projects/Feature/SandBeach/Interface/Sources/SandBeach/SandBeachFeatureInterface.swift index 76894279..c1b86f60 100644 --- a/Projects/Feature/SandBeach/Interface/Sources/SandBeach/SandBeachFeatureInterface.swift +++ b/Projects/Feature/SandBeach/Interface/Sources/SandBeach/SandBeachFeatureInterface.swift @@ -116,7 +116,7 @@ extension SandBeachFeature { .filter { $0.lastStatus != .conversationStopped && $0.lastStatus != .contactSharedByMeOnly }.count let nextBottleLeftHours = userBottleInfo.nextBottlLeftHours - if userProfileStatus == .empty || userProfileStatus == .doneIntroduction { + if userProfileStatus == .empty || userProfileStatus == .doneIntroduction || userProfileStatus == .doneProfileSelect { await send(.userStateFetchCompleted( userState: .noIntroduction, isDisableButton: true)) @@ -140,6 +140,7 @@ extension SandBeachFeature { await send(.userStateFetchCompleted( userState: .noBottle(time: nextBottleLeftHours ?? 0), isDisableButton: false)) + } catch: { error, send in // TODO: 에러 핸들링 Log.error(error) diff --git a/Projects/Feature/Sources/TabView/MainTabViewFeature.swift b/Projects/Feature/Sources/TabView/MainTabViewFeature.swift index df30a2a9..70a4646f 100644 --- a/Projects/Feature/Sources/TabView/MainTabViewFeature.swift +++ b/Projects/Feature/Sources/TabView/MainTabViewFeature.swift @@ -111,7 +111,12 @@ public struct MainTabViewFeature { return .none case .sandBeachButtonDidTapped: state.selectedTab = .sandBeach - return .send(.sandBeachRoot(.sandBeach(.newBottleIslandDidTapped))) + + if state.sandBeachRoot.sandBeach.userState == .noIntroduction { + return .none + } else { + return .send(.sandBeachRoot(.sandBeach(.newBottleIslandDidTapped))) + } } // MyPage Delegate