Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] 수수 Text Writing 정책 변경, 회원가입시 Loading modifier 추가, Delegate 로직 수정 #653

Merged
merged 6 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions Projects/App/Sources/App/SSTimeOut.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
12 changes: 6 additions & 6 deletions Projects/Core/SSRegexManager/Sources/RegexPatternString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<BottomSheetYearItem>.State? = nil

init() {
Expand All @@ -45,7 +46,9 @@ struct OnboardingAdditional {
case tappedNextButton
}

enum InnerAction: Equatable {}
enum InnerAction: Equatable {
case isLoading(Bool)
}

enum AsyncAction: Equatable {}

Expand All @@ -59,6 +62,17 @@ struct OnboardingAdditional {

@Dependency(\.onboardingAdditionalNetwork) var network

private func handleSignup(send _: Send<Action>) 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<State, Action> {
Scope(state: \.header, action: \.scope.header) {
HeaderViewFeature()
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down