Skip to content

Commit

Permalink
[Feature#360]: 모래사장 화면 자기소개 작성 및 보틀 보여주기 로직 수정 (#361)
Browse files Browse the repository at this point in the history
* feat: 모래사장 화면 자기소개 작성 및 보틀 보여주기 로직 수정

* feat: 자기소개 작성 완료 시 마이페이지 업데이트

* feat: 프로필 설정만 한 유저 상태 로직 추가

* feat: 자기소개 작성 안한 사용자 호감 화면 안보이게 수정
  • Loading branch information
leemhyungyu authored Nov 11, 2024
1 parent 5261440 commit add8d73
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
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

0 comments on commit add8d73

Please sign in to comment.