From 6200ac7149769a006bc788bf69566e633082eaec Mon Sep 17 00:00:00 2001 From: Minseo Park <125115284+FpRaArNkK@users.noreply.github.com> Date: Sat, 15 Feb 2025 13:50:05 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[Fix]=20PT=20=EC=88=98=EC=97=85=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=EC=8B=9C=20=EC=A4=91=EB=B3=B5=20=EC=B2=B4=ED=81=AC=20?= =?UTF-8?q?=EB=B0=A9=EC=A7=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Sources/Home/Trainer/TrainerHomeView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift b/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift index ea32db4c..427aca84 100644 --- a/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift +++ b/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift @@ -238,6 +238,7 @@ extension TrainerHomeView { /// 수업 완료 버튼 탭 onTapComplete() } + .disabled(session.isCompleted) VStack(spacing: 12) { HStack(spacing: 4) { From 3568afa5f0285eec6ac05541eb7f3b5c11670292 Mon Sep 17 00:00:00 2001 From: Minseo Park <125115284+FpRaArNkK@users.noreply.github.com> Date: Sat, 15 Feb 2025 13:50:23 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[Chore]=20=EA=B8=B0=EB=A1=9D=20=EB=82=A8?= =?UTF-8?q?=EA=B8=B0=EA=B8=B0=20=EC=88=A8=EA=B9=80=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Sources/Home/Trainer/TrainerHomeView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift b/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift index 427aca84..331effd5 100644 --- a/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift +++ b/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeView.swift @@ -257,7 +257,8 @@ extension TrainerHomeView { .frame(maxWidth: .infinity, alignment: .leading) } - if session.isCompleted { + if false { +// if session.isCompleted { Button { onTap?() } label: { From 9fa91c5a8dba44497a06e0efc15ee8742c9cc82c Mon Sep 17 00:00:00 2001 From: Minseo Park <125115284+FpRaArNkK@users.noreply.github.com> Date: Sat, 15 Feb 2025 13:50:45 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[Feat]=20=ED=8A=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EB=84=88=20=ED=99=88=20=EC=A7=84=EC=9E=85=20=EC=8B=9C=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Trainer/TrainerHomeFeature.swift | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeFeature.swift b/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeFeature.swift index 887c2ac6..489dd757 100644 --- a/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeFeature.swift +++ b/TnT/Projects/Presentation/Sources/Home/Trainer/TrainerHomeFeature.swift @@ -20,6 +20,8 @@ public struct TrainerHomeFeature { // MARK: Data related state /// 3일 동안 보지 않기 시작 날짜 @Shared(.appStorage(AppStorage.hideHomePopupUntil)) var hidePopupUntil: Date? + /// 트레이너 연결 여부 + @Shared(.appStorage(AppStorage.isConnected)) var isConnected: Bool = false /// 선택된 날짜 var selectedDate: Date /// 캘린더 이벤트 @@ -34,8 +36,6 @@ public struct TrainerHomeFeature { var tappedsessionInfo: GetDateSessionListEntity? /// 3일 동안 보지 않기 선택되었는지 여부 var isHideUntilSelected: Bool - /// 트레이니 연결 여부 - var isConnected: Bool /// 팝업 관련 Flag var popUpFlag: Bool @@ -56,7 +56,6 @@ public struct TrainerHomeFeature { sessionInfo: WorkoutListItemEntity? = nil, records: [RecordListItemEntity] = [], isHideUntilSelected: Bool = false, - isConnected: Bool = false, view_currentPage: Date = .now, tappedsessionInfo: GetDateSessionListEntity? = nil, view_isPopUpPresented: Bool = false, @@ -68,7 +67,6 @@ public struct TrainerHomeFeature { self.sessionInfo = sessionInfo self.records = records self.isHideUntilSelected = isHideUntilSelected - self.isConnected = isConnected self.view_currentPage = view_currentPage self.tappedsessionInfo = tappedsessionInfo self.view_isPopUpPresented = view_isPopUpPresented @@ -193,12 +191,17 @@ public struct TrainerHomeFeature { let year: Int = Calendar.current.component(.year, from: state.selectedDate) let month: Int = Calendar.current.component(.month, from: state.selectedDate) - if let hideUntil = state.hidePopupUntil, hideUntil > Date() { - state.view_isPopUpPresented = false - } else { - state.popUpFlag = true - state.view_isPopUpPresented = true - } + let hideUntil = state.hidePopupUntil ?? Date() + let hidePopUp = state.isConnected || hideUntil > Date() + state.view_isPopUpPresented = !hidePopUp + state.popUpFlag = !hidePopUp + +// if let hideUntil = state.hidePopupUntil, hideUntil > Date() { +// state.view_isPopUpPresented = false +// } else { +// state.popUpFlag = true +// state.view_isPopUpPresented = true +// } return .concatenate( .send(.view(.fetchMonthlyLessons(year: month == 1 ? year-1 : year, month: month == 1 ? 12 : month-1))), From 9023a16f3628ce1355306a2d840aee63ebf7c0a7 Mon Sep 17 00:00:00 2001 From: Minseo Park <125115284+FpRaArNkK@users.noreply.github.com> Date: Sat, 15 Feb 2025 14:15:34 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[Feat]=20AddDiet,=20AddPTSession=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EB=85=B8=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AddDietRecord/TraineeAddDietRecordFeature.swift | 7 ++++++- .../Sources/AddPTSession/TrainerAddPTSessionFeature.swift | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/TnT/Projects/Presentation/Sources/AddDietRecord/TraineeAddDietRecordFeature.swift b/TnT/Projects/Presentation/Sources/AddDietRecord/TraineeAddDietRecordFeature.swift index 91e80b45..6da5147f 100644 --- a/TnT/Projects/Presentation/Sources/AddDietRecord/TraineeAddDietRecordFeature.swift +++ b/TnT/Projects/Presentation/Sources/AddDietRecord/TraineeAddDietRecordFeature.swift @@ -93,6 +93,8 @@ public struct TraineeAddDietRecordFeature { case api(APIAction) /// 선택된 이미지 데이터 저장 case imagePicked(Data?) + /// 팝업 상태 설정 + case setPopUp(PopUp?) /// 네비게이션 여부 설정 case setNavigating @@ -239,13 +241,16 @@ public struct TraineeAddDietRecordFeature { ), imgData: state.dietImageData ) - await send(.setNavigating) + await send(.setPopUp(.dietAdded)) } } case .imagePicked(let imgData): state.dietImageData = imgData return self.validateAllFields(&state) + + case .setPopUp(let popUp): + return setPopUpStatus(&state, status: popUp) case .setNavigating: return .none diff --git a/TnT/Projects/Presentation/Sources/AddPTSession/TrainerAddPTSessionFeature.swift b/TnT/Projects/Presentation/Sources/AddPTSession/TrainerAddPTSessionFeature.swift index 78bd5866..9c25568f 100644 --- a/TnT/Projects/Presentation/Sources/AddPTSession/TrainerAddPTSessionFeature.swift +++ b/TnT/Projects/Presentation/Sources/AddPTSession/TrainerAddPTSessionFeature.swift @@ -104,6 +104,8 @@ public struct TrainerAddPTSessionFeature { case api(APIAction) /// 현재 관리 회원 목록 설정 case setTraineeList([TraineeListItemEntity]) + /// 팝업 상태 설정 + case setPopUp(PopUp?) /// 네비게이션 여부 설정 case setNavigating @@ -273,7 +275,7 @@ public struct TrainerAddPTSessionFeature { traineeId: traineeId ) ) - await send(.setNavigating) + await send(.setPopUp(.sessionAdded)) } catch { NotificationCenter.default.post(toast: .init(presentType: .text("⚠"), message: "이미 예약된 시간대입니다")) } @@ -284,6 +286,9 @@ public struct TrainerAddPTSessionFeature { state.traineeList = trainees return .none + case .setPopUp(let popUp): + return setPopUpStatus(&state, status: popUp) + case .setNavigating: return .none }