From c0f979a48ad87bccaee87b8eef3980a88bdda6ac Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 24 Oct 2024 10:08:15 -0700 Subject: [PATCH] Add title setting --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 5e4907c..7496604 100644 --- a/main.go +++ b/main.go @@ -294,7 +294,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.state = "Focus" m.startCommands(m.onFocusStart) - return m, tick() + cmds = append(cmds, tick()) case timeMsg: // Handle timer update for each second @@ -326,17 +326,17 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // Run onFocusStart commands m.startCommands(m.onFocusStart) } - - return m, tick() } - return m, tick() + cmds = append(cmds, tick()) case tea.WindowSizeMsg: m.width = msg.Width m.height = msg.Height } + cmds = append(cmds, tea.SetWindowTitle(fmt.Sprintf("Gomodoro - %s", m.state))) + // Get errors from shellrunner for { result := m.shellrunner.GetResults()