diff --git a/Plugins/EnvPlugin/ProjectDescriptionHelpers/InfoPlist.swift b/Plugins/EnvPlugin/ProjectDescriptionHelpers/InfoPlist.swift index 552d655b..30136177 100644 --- a/Plugins/EnvPlugin/ProjectDescriptionHelpers/InfoPlist.swift +++ b/Plugins/EnvPlugin/ProjectDescriptionHelpers/InfoPlist.swift @@ -9,7 +9,7 @@ import ProjectDescription public extension Project { static let infoPlist: [String: InfoPlist.Value] = [ - "CFBundleShortVersionString": "1.0.1", + "CFBundleShortVersionString": "1.0.2", "CFBundleVersion": "1", "UIMainStoryboardFile": "", "UILaunchStoryboardName": "LaunchScreen", diff --git a/Projects/Features/Sources/CommonVariable.swift b/Projects/Features/Sources/CommonVariable.swift index 3ddd6224..d62d926d 100644 --- a/Projects/Features/Sources/CommonVariable.swift +++ b/Projects/Features/Sources/CommonVariable.swift @@ -11,6 +11,9 @@ import ComposableArchitecture public final class CommonVariable { var userId: Int! var nickname: String! + static func testPageURLString(testId: Int) -> String { + return "https://web.keyme.space/test/\(testId)" + } } extension CommonVariable: DependencyKey { diff --git a/Projects/Features/Sources/Home/HomeView.swift b/Projects/Features/Sources/Home/HomeView.swift index 7d187bb9..8f44cd0f 100644 --- a/Projects/Features/Sources/Home/HomeView.swift +++ b/Projects/Features/Sources/Home/HomeView.swift @@ -68,7 +68,7 @@ public struct HomeView: View { needToShowProgressView = true if isSolvedTest { - let url = "https://keyme-frontend.vercel.app/test/\(viewStore.testId)" + let url = CommonVariable.testPageURLString(testId: viewStore.testId) sharedURL = ActivityViewController.SharedURL(url) // API 할당량 넘치면 여기서 응답을 안 주고 막혀버림;; 아나 // let shortURL = try await shortURLAPIManager.request( diff --git a/Projects/Features/Sources/Home/StartTest/StartTestFeature.swift b/Projects/Features/Sources/Home/StartTest/StartTestFeature.swift index 58cd5431..f67d2d2a 100644 --- a/Projects/Features/Sources/Home/StartTest/StartTestFeature.swift +++ b/Projects/Features/Sources/Home/StartTest/StartTestFeature.swift @@ -79,7 +79,7 @@ public struct StartTestFeature: Reducer { state.icon = icon case .startButtonDidTap: - let url = "https://keyme-frontend.vercel.app/test/\(state.testData.testId)" + let url = CommonVariable.testPageURLString(testId: state.testData.testId) state.keymeTestsState = KeymeTestsFeature.State(url: url, authorizationToken: state.authorizationToken) case .keymeTests(.presented(.close)): diff --git a/Projects/Features/Sources/KeymeTests/Result/TestResultView.swift b/Projects/Features/Sources/KeymeTests/Result/TestResultView.swift index e9c0303d..2e9ae231 100644 --- a/Projects/Features/Sources/KeymeTests/Result/TestResultView.swift +++ b/Projects/Features/Sources/KeymeTests/Result/TestResultView.swift @@ -120,8 +120,7 @@ public struct TestResultView: View { .frame(height: 60) .onTapGesture { Task { - // TODO: url 주석단거로 바꾸기 - let url = "https://keyme-frontend.vercel.app/test/\(17)" + let url = CommonVariable.testPageURLString(testId: viewStore.testId) let shortURL = try await shortURLManager.request( .shortenURL(longURL: url), object: BitlyResponse.self).link diff --git a/Projects/Features/Sources/KeymeTests/TestView/NativeTestContentView.swift b/Projects/Features/Sources/KeymeTests/TestView/NativeTestContentView.swift index 0358d21e..676bb2ce 100644 --- a/Projects/Features/Sources/KeymeTests/TestView/NativeTestContentView.swift +++ b/Projects/Features/Sources/KeymeTests/TestView/NativeTestContentView.swift @@ -291,7 +291,7 @@ private extension NativeTestContentView { VStack { Spacer().frame(height: 25 * 2) TestContentCircle( - question: questionsWithScore[min(questionIndexBuffer + 2, limit)].question, + question: questionsWithScore[min(questionIndexBuffer + 2, limit - 1)].question, circleRadius: calculateRadius(score: 3, width: proxy.size.width), color: .white ) diff --git a/Projects/Features/Sources/KeymeTests/TestView/NativeTestView.swift b/Projects/Features/Sources/KeymeTests/TestView/NativeTestView.swift index 9a0d601d..5f2cf05d 100644 --- a/Projects/Features/Sources/KeymeTests/TestView/NativeTestView.swift +++ b/Projects/Features/Sources/KeymeTests/TestView/NativeTestView.swift @@ -27,6 +27,7 @@ public struct NativeTestFeature: Reducer { let questions: [Question] var questionsWithScore: [QuestionWithScore] + var needToShowProgress: Bool = false @PresentationState var alertState: AlertState? @@ -58,6 +59,7 @@ public struct NativeTestFeature: Reducer { case view(View) case alert(PresentationAction) + case showProgress(enabled: Bool) case showErrorAlert(message: String) public enum View: Equatable { @@ -104,6 +106,8 @@ public struct NativeTestFeature: Reducer { }) case .view(.postResult): + state.needToShowProgress = true + return .run { [state] send in do { let response = try await self.network.request( @@ -113,9 +117,10 @@ public struct NativeTestFeature: Reducer { object: SubmitResponseDTO.self) await send(.showResult(response.data)) + await send(.showProgress(enabled: false)) } catch { - print(error) await send(.showErrorAlert(message: "오류가 발생했습니다. 잠시 후 다시 시도해주세요.")) + await send(.showProgress(enabled: false)) } } @@ -128,7 +133,12 @@ public struct NativeTestFeature: Reducer { case .submit: return .none + case .showProgress(let enabled): + state.needToShowProgress = enabled + return .none + case .showErrorAlert(let message): + state.needToShowProgress = false state.alertState = AlertState.errorWithMessage(message) case .alert(.presented(.closeTest)): @@ -221,6 +231,7 @@ public struct NativeTestView: View { .toolbar(.hidden, for: .navigationBar) .alert(store: store.scope(state: \.$alertState, action: NativeTestFeature.Action.alert)) } + .fullscreenProgressView(isShown: viewStore.needToShowProgress) } .transition(.opacity.animation(Animation.customInteractiveSpring(duration: 1))) } diff --git a/Projects/Features/Sources/MyPage/MyPageFeature.swift b/Projects/Features/Sources/MyPage/MyPageFeature.swift index e09cbde9..7b581690 100644 --- a/Projects/Features/Sources/MyPage/MyPageFeature.swift +++ b/Projects/Features/Sources/MyPage/MyPageFeature.swift @@ -41,7 +41,7 @@ public struct MyPageFeature: Reducer { return commonVariable.nickname } let testId: Int - var testURL: String { "https://keyme-frontend.vercel.app/test/\(testId)" } + var testURL: String { CommonVariable.testPageURLString(testId: testId) } var imageExportMode = false @@ -80,6 +80,7 @@ public struct MyPageFeature: Reducer { case prepareSettingView case selectSegement(MyPageSegment) case enableImageExportMode + case disableImageExportMode case captureImage case requestTestURL } @@ -194,6 +195,11 @@ public struct MyPageFeature: Reducer { return .none + case .view(.disableImageExportMode): + state.imageExportModeState = nil + + return .none + case .view(.requestTestURL): return .run { [testURL = state.view.testURL] send in do { diff --git a/Projects/Features/Sources/MyPage/MyPageView.swift b/Projects/Features/Sources/MyPage/MyPageView.swift index b5b875a9..1f811efd 100644 --- a/Projects/Features/Sources/MyPage/MyPageView.swift +++ b/Projects/Features/Sources/MyPage/MyPageView.swift @@ -96,7 +96,7 @@ struct MyPageView: View { .transition(.opacity) } - // Export 모드에 진입합니다 + // Export 모드에 진입합니다 IfLetStore(store.scope( state: \.imageExportModeState, action: MyPageFeature.Action.imageExportModeAction) @@ -115,17 +115,21 @@ struct MyPageView: View { } .transition( .opacity.combined(with: .scale(scale: 1.5)) - .animation(Animation.customInteractiveSpring())) + .animation(Animation.customInteractiveSpring(duration: 0.5))) .zIndex(ViewZIndex.high.rawValue) - } } .toolbar(viewStore.imageExportMode ? .hidden : .visible, for: .tabBar) +// .onDisappear { +// viewStore.send(.disableImageExportMode) +// graphScale /= exportModeScale +// } + .fullFrame() + .border(DSKitAsset.Color.keymeBlack.swiftUIColor, width: viewStore.imageExportMode ? 5 : 0) .alert(store: store.scope(state: \.$alertState, action: MyPageFeature.Action.alert)) .animation(Animation.customInteractiveSpring(duration: 0.5), value: viewStore.circleShown) - .animation(Animation.customInteractiveSpring(), value: viewStore.imageExportMode) - .animation(Animation.customInteractiveSpring(), value: viewStore.nowFetching) - .border(DSKitAsset.Color.keymeBlack.swiftUIColor, width: viewStore.imageExportMode ? 5 : 0) + .animation(Animation.customInteractiveSpring(duration: 0.5), value: viewStore.imageExportMode) + .animation(Animation.customInteractiveSpring(duration: 0.5), value: viewStore.nowFetching) .fullscreenProgressView(isShown: needToShowProgressView) } .navigationDestination( diff --git a/Projects/Features/Sources/Onboarding/OnboardingFeature.swift b/Projects/Features/Sources/Onboarding/OnboardingFeature.swift index 9ce2c40f..d6850e81 100644 --- a/Projects/Features/Sources/Onboarding/OnboardingFeature.swift +++ b/Projects/Features/Sources/Onboarding/OnboardingFeature.swift @@ -113,7 +113,7 @@ public struct OnboardingFeature: Reducer { } case .startButtonDidTap: - let url = "https://keyme-frontend.vercel.app/test/\(state.testData.testId)" + let url = CommonVariable.testPageURLString(testId: state.testData.testId) state.keymeTestsState = NativeTestFeature.State( testId: state.testData.testId, nickname: state.nickname,