From fefe9bb6aadc957db510a9f675f75d26332b1212 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Fri, 18 Oct 2024 09:06:03 -0700 Subject: [PATCH] Fix interval end event trigger --- main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.go b/main.go index 5bf6945..d855906 100644 --- a/main.go +++ b/main.go @@ -147,8 +147,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Handle timer update for each second m.remaining -= time.Second if m.remaining < 0 { - m.runCommands(m.onIntervalEnd) - if m.isFocus { // Focus period ends, switch to break m.isFocus = false @@ -162,6 +160,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Break ends, switch back to focus or next interval m.isFocus = true m.intervalNum++ + m.runCommands(m.onIntervalEnd) if m.intervalNum > m.intervals { // All intervals completed return m, tea.Quit