Smoothened dismiss timer

This commit is contained in:
Hariharan Mudaliar 2025-11-28 19:33:51 +05:30
commit f9a8887879
2 changed files with 18 additions and 6 deletions

View file

@ -201,12 +201,23 @@ struct LockScreenTimerWidget: View {
}
private func stopTimer() {
guard timerManager.allowsManualInteraction else {
timerManager.endExternalTimer(triggerSmoothClose: false)
return
let stopAction: @MainActor () -> Void = {
if timerManager.allowsManualInteraction {
timerManager.stopTimer()
} else {
timerManager.endExternalTimer(triggerSmoothClose: false)
}
}
Task { @MainActor in
// Trigger the scale-out animation first so the dismissal mirrors the unlock flow.
LockScreenTimerWidgetPanelManager.shared.hide()
try? await Task.sleep(nanoseconds: LockScreenTimerWidgetPanelManager.hideAnimationDurationNanoseconds)
guard !Task.isCancelled else { return }
stopAction()
}
timerManager.stopTimer()
LockScreenTimerWidgetPanelManager.shared.hide()
}
private struct CircleButton: View {