Skip to content

Commit

Permalink
Merge pull request #97 from YAPP-Github/TNT-254-QA
Browse files Browse the repository at this point in the history
[TNT-254] μ‹€μ‹œκ°„ QA 반영
  • Loading branch information
syss220211 authored Feb 15, 2025
2 parents a72948b + 9023a16 commit 4921687
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ public struct TraineeAddDietRecordFeature {
case api(APIAction)
/// μ„ νƒλœ 이미지 데이터 μ €μž₯
case imagePicked(Data?)
/// νŒμ—… μƒνƒœ μ„€μ •
case setPopUp(PopUp?)
/// λ„€λΉ„κ²Œμ΄μ…˜ μ—¬λΆ€ μ„€μ •
case setNavigating

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public struct TrainerAddPTSessionFeature {
case api(APIAction)
/// ν˜„μž¬ 관리 νšŒμ› λͺ©λ‘ μ„€μ •
case setTraineeList([TraineeListItemEntity])
/// νŒμ—… μƒνƒœ μ„€μ •
case setPopUp(PopUp?)
/// λ„€λΉ„κ²Œμ΄μ…˜ μ—¬λΆ€ μ„€μ •
case setNavigating

Expand Down Expand Up @@ -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: "이미 μ˜ˆμ•½λœ μ‹œκ°„λŒ€μž…λ‹ˆλ‹€"))
}
Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
/// μΊ˜λ¦°λ” 이벀트
Expand All @@ -34,8 +36,6 @@ public struct TrainerHomeFeature {
var tappedsessionInfo: GetDateSessionListEntity?
/// 3일 λ™μ•ˆ 보지 μ•ŠκΈ° μ„ νƒλ˜μ—ˆλŠ”μ§€ μ—¬λΆ€
var isHideUntilSelected: Bool
/// νŠΈλ ˆμ΄λ‹ˆ μ—°κ²° μ—¬λΆ€
var isConnected: Bool
/// νŒμ—… κ΄€λ ¨ Flag
var popUpFlag: Bool

Expand All @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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))),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ extension TrainerHomeView {
/// μˆ˜μ—… μ™„λ£Œ λ²„νŠΌ νƒ­
onTapComplete()
}
.disabled(session.isCompleted)

VStack(spacing: 12) {
HStack(spacing: 4) {
Expand All @@ -256,7 +257,8 @@ extension TrainerHomeView {
.frame(maxWidth: .infinity, alignment: .leading)
}

if session.isCompleted {
if false {
// if session.isCompleted {
Button {
onTap?()
} label: {
Expand Down

0 comments on commit 4921687

Please sign in to comment.