From a3e6febcfd57cba1b9319fe8eb2963fe2f9df96b Mon Sep 17 00:00:00 2001 From: d-kimsuon Date: Sun, 7 Sep 2025 18:07:06 +0900 Subject: [PATCH] feat: add sonner message on task completed --- src/hooks/useTaskNotifications.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hooks/useTaskNotifications.ts b/src/hooks/useTaskNotifications.ts index 592c575..7f8bb3f 100644 --- a/src/hooks/useTaskNotifications.ts +++ b/src/hooks/useTaskNotifications.ts @@ -1,5 +1,6 @@ import { useAtomValue } from "jotai"; import { useEffect, useRef } from "react"; +import { toast } from "sonner"; import { notificationSettingsAtom, soundNotificationsEnabledAtom, @@ -26,9 +27,13 @@ export const useTaskNotifications = (isRunningTask: boolean) => { prevIsRunningRef.current = currentIsRunning; // Detect task completion: was running, now not running - if (prevIsRunning && !currentIsRunning && soundEnabled) { - // Play notification sound - playNotificationSound(settings.soundType); + if (prevIsRunning && !currentIsRunning) { + toast.success("Task completed"); + + if (soundEnabled) { + // Play notification sound + playNotificationSound(settings.soundType); + } } }, [isRunningTask, soundEnabled, settings.soundType]); };