Skip to content

Commit

Permalink
[#84] 혼선방지를 위해 Alert enum 케이스에 Tapped접미사 추가
Browse files Browse the repository at this point in the history
- confirmLogoutTapped
- configurePushAuthorizationTapped
  • Loading branch information
CJiu01 committed Feb 5, 2025
1 parent 2d55349 commit 5073dfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Soomsil-USaint/Application/AppReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct AppReducer {
case .login(.loginResponse(.success(let (info, report)))):
state = .loggedIn(HomeReducer.State(studentInfo: info, totalReportCard: report))
return .none
case .home(.path(.element(id: _, action: .setting(.alert(.presented(.logout)))))):
case .home(.path(.element(id: _, action: .setting(.alert(.presented(.confirmLogoutTapped)))))):
state = .loggedOut(LoginReducer.State())
return .none
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ struct SettingReducer {
case alert(PresentationAction<Alert>)

enum Alert: Equatable {
case logout
case configurePushAuthorization
case confirmLogoutTapped
case configurePushAuthorizationTapped
}
}

Expand All @@ -46,7 +46,7 @@ struct SettingReducer {
} actions: {
ButtonState(
role: .destructive,
action: .logout) {
action: .confirmLogoutTapped) {
TextState("로그아웃")
}
ButtonState(
Expand All @@ -55,7 +55,7 @@ struct SettingReducer {
}
}
return .none
case .alert(.presented(.logout)):
case .alert(.presented(.confirmLogoutTapped)):
YDSToast("로그아웃 완료", haptic: .success)
return .none
case .togglePushAuthorization(true):
Expand All @@ -75,7 +75,7 @@ struct SettingReducer {
} actions: {
ButtonState(
role: .destructive,
action: .configurePushAuthorization
action: .configurePushAuthorizationTapped
) {
TextState("설정")
}
Expand All @@ -101,7 +101,7 @@ struct SettingReducer {
}
}
return .none
case .alert(.presented(.configurePushAuthorization)):
case .alert(.presented(.configurePushAuthorizationTapped)):
debugPrint("alert permission")
return .run { send in
await send(.requestPushAuthorizationResponse(Result {
Expand Down

0 comments on commit 5073dfd

Please sign in to comment.