diff --git a/FootballGather/Packages/UseCases/Gather/Gather/Sources/Gather/Views/TimerView.swift b/FootballGather/Packages/UseCases/Gather/Gather/Sources/Gather/Views/TimerView.swift index fe38d8c..faf7c1e 100644 --- a/FootballGather/Packages/UseCases/Gather/Gather/Sources/Gather/Views/TimerView.swift +++ b/FootballGather/Packages/UseCases/Gather/Gather/Sources/Gather/Views/TimerView.swift @@ -38,7 +38,11 @@ struct TimerView: View { .alert(LocalizedString.timeIsUpTitle, isPresented: $viewModel.timeIsUp) { Button(LocalizedString.ok, role: .cancel) {} } - .onChange(of: scenePhase, perform: onScheneChanged) + .onChange(of: scenePhase, { _, newValue in + Task { + await viewModel.onScenePhaseChanged(to: newValue) + } + }) .task { await viewModel.askForNotificationPermissions() } } @@ -67,10 +71,6 @@ struct TimerView: View { .accessibilityLabel(viewModel.actionButtonAccessibilityLabel) } - private func onScheneChanged(to newValue: ScenePhase) { - Task { await viewModel.onScenePhaseChanged(to: newValue) } - } - } // MARK: - Preview