mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Fully fixed: Timer Lock Screen Widget
This commit is contained in:
parent
f9a8887879
commit
a08540c589
3 changed files with 36 additions and 14 deletions
|
|
@ -201,22 +201,22 @@ struct LockScreenTimerWidget: View {
|
|||
}
|
||||
|
||||
private func stopTimer() {
|
||||
let stopAction: @MainActor () -> Void = {
|
||||
if timerManager.allowsManualInteraction {
|
||||
timerManager.stopTimer()
|
||||
} else {
|
||||
timerManager.endExternalTimer(triggerSmoothClose: false)
|
||||
}
|
||||
}
|
||||
let allowsManualInteraction = timerManager.allowsManualInteraction
|
||||
|
||||
Task { @MainActor in
|
||||
// Trigger the scale-out animation first so the dismissal mirrors the unlock flow.
|
||||
LockScreenTimerWidgetPanelManager.shared.hide()
|
||||
LockScreenTimerWidgetPanelManager.shared.hide()
|
||||
|
||||
Task.detached(priority: .userInitiated) { [allowsManualInteraction] in
|
||||
try? await Task.sleep(nanoseconds: LockScreenTimerWidgetPanelManager.hideAnimationDurationNanoseconds)
|
||||
|
||||
guard !Task.isCancelled else { return }
|
||||
stopAction()
|
||||
|
||||
await MainActor.run {
|
||||
if allowsManualInteraction {
|
||||
TimerManager.shared.stopTimer()
|
||||
} else {
|
||||
TimerManager.shared.endExternalTimer(triggerSmoothClose: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue