mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-01-21 06:34:30 +01:00
redeem link + completing task + play sound
This commit is contained in:
@@ -148,14 +148,6 @@ export default function PomodoroTimer() {
|
||||
}
|
||||
}, [state])
|
||||
|
||||
|
||||
const playSound = useCallback(() => {
|
||||
const audio = new Audio('/sounds/timer-end.wav')
|
||||
audio.play().catch(error => {
|
||||
console.error('Error playing sound:', error)
|
||||
})
|
||||
}, [])
|
||||
|
||||
const handleTimerEnd = async () => {
|
||||
setState("stopped")
|
||||
const currentTimerType = currentTimer.current.type
|
||||
@@ -165,9 +157,6 @@ export default function PomodoroTimer() {
|
||||
currentTimer.current.labels[Math.floor(Math.random() * currentTimer.current.labels.length)]
|
||||
)
|
||||
|
||||
// Play sound
|
||||
playSound()
|
||||
|
||||
// update habits only after focus sessions
|
||||
if (selectedHabit && currentTimerType === 'focus') {
|
||||
await completeHabit(selectedHabit)
|
||||
|
||||
Reference in New Issue
Block a user