@@ -25,25 +25,28 @@ struct PushNotificationSettingsView: View {
2525 } )
2626 Section {
2727 ForEach ( [ 9 , 15 , 18 , 21 ] , id: \. self) { hour in
28- HStack {
29- Text ( ( hour < 12 ? " 오전 \( hour) 시 " : " 오후 \( hour - 12 ) 시 " ) )
30- Spacer ( )
31- if viewModel. state. pushNotificationHour == hour {
32- Image ( systemName: " checkmark " )
33- . foregroundStyle ( Color . accentColor)
28+ if let date = Calendar . current. date ( bySettingHour: hour, minute: 0 , second: 0 , of: Date ( ) ) {
29+ HStack {
30+ Text ( formattedTimeString ( date) )
31+ Spacer ( )
32+ if viewModel. state. pushNotificationHour == hour &&
33+ viewModel. state. pushNotificationMinute == 0 {
34+ Image ( systemName: " checkmark " )
35+ . foregroundStyle ( Color . accentColor)
36+ }
37+ }
38+ . contentShape ( Rectangle ( ) )
39+ . onTapGesture {
40+ viewModel. send ( . setPushNotificationHour( hour) )
3441 }
35- }
36- . contentShape ( Rectangle ( ) )
37- . onTapGesture {
38- viewModel. send ( . setPushNotificationHour( hour) )
3942 }
4043 }
4144 HStack {
4245 Text ( " 사용자 설정 " )
4346 Spacer ( )
4447 Text ( formattedTimeString ( viewModel. state. pushNotificationTime) )
4548 . foregroundStyle ( . secondary)
46- if ! [ 9 , 15 , 18 , 21 ] . contains ( viewModel. state. pushNotificationHour ) {
49+ if viewModel. state. pushNotificationMinute != 0 {
4750 Image ( systemName: " checkmark " )
4851 . foregroundStyle ( Color . accentColor)
4952 }
0 commit comments