diff --git a/Projects/Feature/BottleStorage/Example/Sources/AppView.swift b/Projects/Feature/BottleStorage/Example/Sources/AppView.swift index ef784883..e05e0e8c 100644 --- a/Projects/Feature/BottleStorage/Example/Sources/AppView.swift +++ b/Projects/Feature/BottleStorage/Example/Sources/AppView.swift @@ -21,12 +21,6 @@ struct AppView: App { initialState: BottleStorageFeature.State(), reducer: { BottleStorageFeature() } )) - .onAppear { - AuthClient.liveValue.saveToken(token: .init( - accessToken: "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNzIzMTE3ODk1LCJleHAiOjE3MjMxNTM4OTV9.HjjnS1onaAUA6nJGOV-f6FE55eAihUGTFNYGmmyETQc", - refershToken: "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNzIzMTE3ODk1LCJleHAiOjE3Mzc2MzMwOTV9.Af-L2h_5pBQWrZCc1OQI3tm1DGwowqCAId-rK5vAPaQ" - )) - } } } } diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift index cc01fbd4..d1ee40f0 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift @@ -54,6 +54,8 @@ extension PingPongDetailFeature { return fetchPingPong(state: &state) case .popToRootDidRequired: return .send(.delegate(.popToRootDidRequired)) + case .refreshPingPong: + return fetchPingPong(state: &state) } case let .matching(.delegate(delegate)): diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift index a2aa05db..5a4dc213 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift @@ -82,7 +82,7 @@ extension QuestionAndAnswerFeature { } } - case .stopTalkButtonTapped: + case .stopTalkButtonDidTapped: state.destination = .alert(.init( title: { TextState("중단하기") }, actions: { @@ -94,6 +94,9 @@ extension QuestionAndAnswerFeature { message: { TextState("중단 시 모든 핑퐁 내용이 사라져요. 정말 중단하시겠어요?") } )) return .none + + case .refreshDidPulled: + return .send(.delegate(.refreshPingPong)) case let .destination(.presented(.alert(alert))): switch alert { diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift index 325aa352..4353b898 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift @@ -204,7 +204,8 @@ public struct QuestionAndAnswerFeature { case finalSelectButtonDidTapped(willMatch: Bool) case refreshPingPongDidRequired case configureShowLoadingIndicatorRequired(isShow: Bool) - case stopTalkButtonTapped + case stopTalkButtonDidTapped + case refreshDidPulled // ETC. case binding(BindingAction) @@ -220,6 +221,7 @@ public struct QuestionAndAnswerFeature { public enum Delegate { case reloadPingPongRequired case popToRootDidRequired + case refreshPingPong } } diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift index 8123ba2f..b8208f68 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift @@ -103,7 +103,7 @@ public struct QuestionAndAnswerView: View { color: .enableSecondary ) .asThrottleButton { - store.send(.stopTalkButtonTapped) + store.send(.stopTalkButtonDidTapped) } .padding(.top, 12.0) .disabled(store.isStopped == true) @@ -122,6 +122,10 @@ public struct QuestionAndAnswerView: View { isTextFieldFocused = textFieldState == .active || textFieldState == .enabled ? false : true } } + .refreshable { + try? await Task.sleep(nanoseconds: 300_000_000) + await store.send(.refreshDidPulled).finish() + } .scrollIndicators(.hidden) .overlay { if store.isShowLoadingIndicator {