Skip to content

Commit 4766ef8

Browse files
committed
[Fix] Coordinator popToRoot 로직 수정
1 parent b191387 commit 4766ef8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

TnT/Projects/Presentation/Sources/Coordinator/TraineeMainFlow/TraineeMainFlowFeature.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ public struct TraineeMainFlowFeature {
8989

9090
/// 식단 기록 화면 등록 -> 홈화면으로 이동
9191
case .element(id: _, action: .addDietRecordPage(.setNavigating)):
92-
state.path.removeLast()
92+
state.path.removeSubrange(1...)
9393
return .none
9494

9595
/// 마이페이지 초대코드 입력화면 다음 버튼 탭 - > PT 정보 입력 화면 or 홈 이동
9696
case .element(_, action: .traineeInvitationCodeInput(.setNavigating(let screen))):
9797
switch screen {
9898
case .traineeHome:
99-
state.path.removeLast()
99+
state.path.removeSubrange(1...)
100100
case let .trainingInfoInput(trainerName, invitationCode):
101101
state.path.append(.traineeTrainingInfoInput(.init(trainerName: trainerName, invitationCode: invitationCode)))
102102
}
@@ -119,7 +119,7 @@ public struct TraineeMainFlowFeature {
119119

120120
/// 연결 완료 화면 -> 홈으로 이동
121121
case .element(id: _, action: .traineeConnectionComplete(.setNavigating)):
122-
state.path.removeLast(2)
122+
state.path.removeSubrange(1...)
123123
return .none
124124

125125
default:

TnT/Projects/Presentation/Sources/Coordinator/TrainerMainFlow/TrainerMainFlowFeature.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public struct TrainerMainFlowFeature {
7272

7373
/// 트레이너 초대코드 발급 페이지 건너 뛰기 -> 홈으로
7474
case .element(id: _, action: .trainerMakeInvitationCodePage(.setNavigation)):
75-
state.path.removeLast()
75+
state.path.removeSubrange(1...)
7676
return .none
7777

7878
/// 연결 완료 -> 트레이니 정보
@@ -82,12 +82,12 @@ public struct TrainerMainFlowFeature {
8282

8383
/// 트레이니 정보 -> 홈으로
8484
case .element(id: _, action: .connectedTraineeProfile(.setNavigating)):
85-
state.path.removeLast(2)
85+
state.path.removeSubrange(1...)
8686
return.none
8787

8888
/// 트레이너 수업 추가 -> 홈으로
8989
case .element(id: _, action: .addPTSession(.setNavigating)):
90-
state.path.removeLast()
90+
state.path.removeSubrange(1...)
9191
return .none
9292

9393
default:

0 commit comments

Comments
 (0)