From df29146676087f39b655424c69b7d1a8795590d6 Mon Sep 17 00:00:00 2001 From: Beingpax Date: Mon, 23 Jun 2025 10:39:46 +0545 Subject: [PATCH] Reminder for no audio notification --- VoiceInk/Recorder.swift | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/VoiceInk/Recorder.swift b/VoiceInk/Recorder.swift index 6daa5e8..ccb4f7e 100644 --- a/VoiceInk/Recorder.swift +++ b/VoiceInk/Recorder.swift @@ -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",