diff --git a/Projects/App/Project.swift b/Projects/App/Project.swift index cf623977..bcdbee5c 100644 --- a/Projects/App/Project.swift +++ b/Projects/App/Project.swift @@ -27,8 +27,8 @@ let project = Project.makeModule( "CFBundleDisplayName": "수수", "UILaunchStoryboardName": "LaunchScreen", "BGTaskSchedulerPermittedIdentifiers": "com.oksusu.susu.app", - "CFBundleShortVersionString": "1.1.1", - "CFBundleVersion": "2024112844", + "CFBundleShortVersionString": "1.1.2", + "CFBundleVersion": "2025011545", "UIUserInterfaceStyle": "Light", "ITSAppUsesNonExemptEncryption": "No", "AppstoreAPPID": "6503701515", diff --git a/Projects/App/Sources/App/SSTimeOut.swift b/Projects/App/Sources/App/SSTimeOut.swift index 14f0b12d..0a817539 100644 --- a/Projects/App/Sources/App/SSTimeOut.swift +++ b/Projects/App/Sources/App/SSTimeOut.swift @@ -24,14 +24,14 @@ final class SSTimeOut { static func enterBackground() { os_log("백그라운드 진입") - if shared.initialLoading == false { - shared.initialLoading = true - return - } shared.enteredBackgroundDate = Date.now } static func enterForegroundScreen() { + if shared.initialLoading == false { + shared.initialLoading = true + return + } os_log("포그라운드 진입") reloadToken() } diff --git a/Projects/Core/SSRegexManager/Sources/RegexPatternString.swift b/Projects/Core/SSRegexManager/Sources/RegexPatternString.swift index fb76c77a..42c6f92f 100644 --- a/Projects/Core/SSRegexManager/Sources/RegexPatternString.swift +++ b/Projects/Core/SSRegexManager/Sources/RegexPatternString.swift @@ -22,19 +22,19 @@ public enum RegexPatternString { public var regexString: String { switch self { case .name: - "^[가-힣|a-z|A-Z|0-9| |.]{1,10}$" + "^\\S(?:.{0,8}\\S)?$" case .price: "^[\\d]{1,10}$" case .relationship: - "^[가-힣|a-z|A-Z| ]{1,10}$" + "^\\S(?:.{0,8}\\S)?$" case .category: - "^[가-힣|a-z|A-Z| ]{1,10}$" + "^\\S(?:.{0,8}\\S)?$" case .ledger: - "^[가-힣|a-z|A-Z| ]{1,10}$" + "^\\S(?:.{0,8}\\S)?$" case .gift: - "^[가-힣|a-z|A-Z|0-9| ]{1,30}$" + "^\\S(?:.{0,28}\\S)?$" case .memo: - "^.{1,30}$" + "^\\S(?:.{0,28}\\S)?$" case .contacts: "^[\\d]{11}$" case .voteContents: diff --git a/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditional.swift b/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditional.swift index 1a624aa3..97ece5c7 100644 --- a/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditional.swift +++ b/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditional.swift @@ -23,6 +23,7 @@ struct OnboardingAdditional { var header: HeaderViewFeature.State = .init(.init(type: .depthProgressBar(1))) var presentBirthBottomSheet: Bool = false var helper: OnboardingAdditionalProperty + var isLoading: Bool = false @Presents var bottomSheet: SSSelectableBottomSheetReducer.State? = nil init() { @@ -45,7 +46,9 @@ struct OnboardingAdditional { case tappedNextButton } - enum InnerAction: Equatable {} + enum InnerAction: Equatable { + case isLoading(Bool) + } enum AsyncAction: Equatable {} @@ -59,6 +62,17 @@ struct OnboardingAdditional { @Dependency(\.onboardingAdditionalNetwork) var network + private func handleSignup(send _: Send) async throws { + guard let body = SharedStateContainer.getValue(SignUpBodyProperty.self) else { + return + } + let response = try await network.requestSignUp(body) + try OnboardingAdditionalPersistence.saveToken(response) + + let userID = try await network.requestUserID() + try await OnboardingAdditionalPersistence.saveUserID(userID) + } + var body: some Reducer { Scope(state: \.header, action: \.scope.header) { HeaderViewFeature() @@ -93,19 +107,22 @@ struct OnboardingAdditional { body.setGender(state.helper.selectedGenderItem) body.setBirth(state.helper.selectedBirthItemToBodyString()) - return .ssRun { _ in - // 화면 전환 - defer { + return .ssRun { send in + await send(.inner(.isLoading(true))) + do { + try await handleSignup(send: send) NotificationCenter.default.post(name: SSNotificationName.goMainScene, object: nil) + } catch { + throw error } - let response = try await network.requestSignUp(body) - try OnboardingAdditionalPersistence.saveToken(response) - - let userID = try await network.requestUserID() - try await OnboardingAdditionalPersistence.saveUserID(userID) + await send(.inner(.isLoading(false))) } case .scope(.bottomSheet): return .none + + case let .inner(.isLoading(val)): + state.isLoading = val + return .none } } .addFeatures0() diff --git a/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditionalView.swift b/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditionalView.swift index 40cb53ca..6ddb99d9 100644 --- a/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditionalView.swift +++ b/Projects/Feature/Onboarding/Sources/OnboardingAdditional/OnboardingAdditionalView.swift @@ -125,6 +125,7 @@ struct OnboardingAdditionalView: View { .safeAreaInset(edge: .bottom) { makeNextScreenButton() } + .ssLoading(store.isLoading) .selectableBottomSheetWithBottomView( store: $store.scope(state: \.bottomSheet, action: \.scope.bottomSheet), cellCount: 6,