Reminder for no audio notification

This commit is contained in:
Beingpax 2025-06-23 10:39:46 +05:45
parent 17c2ca4e2e
commit df29146676

View File

@ -125,11 +125,17 @@ class Recorder: ObservableObject {
}
audioLevelCheckTask = Task {
try? await Task.sleep(nanoseconds: 2_000_000_000)
if Task.isCancelled { return }
if !self.hasDetectedAudioInCurrentSession {
let notificationChecks: [TimeInterval] = [2.0, 8.0]
for delay in notificationChecks {
try? await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000))
if Task.isCancelled { return }
if self.hasDetectedAudioInCurrentSession {
return
}
await MainActor.run {
NotificationManager.shared.showNotification(
title: "No Audio Detected",