Prevent screen lock during a call

This commit is contained in:
Benoit Martins 2024-05-06 16:27:17 +02:00
parent 6d8dfbf1a1
commit 69165aa3ed

View file

@ -962,6 +962,7 @@ struct ContentView: View {
.zIndex(5)
.transition(.scale.combined(with: .move(edge: .top)))
.onAppear {
UIApplication.shared.isIdleTimerDisabled = true
callViewModel.resetCallView()
if callViewModel.calls.count >= 1 {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
@ -969,6 +970,9 @@ struct ContentView: View {
}
}
}
.onDisappear {
UIApplication.shared.isIdleTimerDisabled = false
}
}
ToastView()