@@ -91,7 +91,10 @@ struct PushNotificationSettingsFeature {
9191 guard let time = state. timePicker? . time else { break }
9292 state. viewPushNotificationTime = time
9393 state. activeLoadingRow = . customTime
94- return updatePushNotificationSettingsEffect ( settings: Self . settings ( from: state) )
94+ return updatePushNotificationSettingsEffect (
95+ settings: Self . settings ( from: state) ,
96+ dismissesTimePickerOnSuccess: true
97+ )
9598 case . timePicker:
9699 break
97100 case . fetchSettings:
@@ -195,13 +198,18 @@ private extension PushNotificationSettingsFeature {
195198 }
196199 }
197200
198- func updatePushNotificationSettingsEffect( settings: PushNotificationSettings ) -> Effect < Action > {
201+ func updatePushNotificationSettingsEffect(
202+ settings: PushNotificationSettings ,
203+ dismissesTimePickerOnSuccess: Bool = false
204+ ) -> Effect < Action > {
199205 . run { [ updatePushSettingsUseCase] send in
200206 await send ( . loading( . begin( target: . default, mode: . delayed) ) )
201207 do {
202208 try await updatePushSettingsUseCase. execute ( settings)
203209 await send ( . loading( . end( target: . default, mode: . delayed) ) )
204- await send ( . timePicker( . dismiss) )
210+ if dismissesTimePickerOnSuccess {
211+ await send ( . timePicker( . dismiss) )
212+ }
205213 await send ( . clearActiveLoadingRow)
206214 } catch {
207215 await send ( . loading( . end( target: . default, mode: . delayed) ) )
0 commit comments