Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature#360]: 모래사장 화면 자기소개 작성 및 보틀 보여주기 로직 수정 #361

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self> {
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -140,6 +140,7 @@ extension SandBeachFeature {
await send(.userStateFetchCompleted(
userState: .noBottle(time: nextBottleLeftHours ?? 0),
isDisableButton: false))

} catch: { error, send in
// TODO: 에러 핸들링
Log.error(error)
Expand Down
7 changes: 6 additions & 1 deletion Projects/Feature/Sources/TabView/MainTabViewFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down