From c24c277fb11b0c2e411cea64f24a81d83f9ff0a6 Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 11 Apr 2025 16:05:13 +0200 Subject: [PATCH] fix: remember to toggle off tempAuthorAdd when quitting --- src/cmd/tui/tui_author.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cmd/tui/tui_author.go b/src/cmd/tui/tui_author.go index 5c9e88a..3c7d9ba 100644 --- a/src/cmd/tui/tui_author.go +++ b/src/cmd/tui/tui_author.go @@ -50,7 +50,7 @@ func errorGetMissingFields(m model_ca) { } if len(m.inputs) > 0 { - for i := 0; i < inpLen-1; i++ { + for i := 0; i < inpLen; i++ { if m.inputs[i].Value() == "" { m.errorModel.missing = append(m.errorModel.missing, "- "+strings.Split(m.inputs[i].Placeholder," (")[0]) } @@ -276,6 +276,7 @@ func (m model_ca) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.KeyMsg: switch msg.String() { case "ctrl+c", "esc": + tempAuthorToggle = false m.inputs = nil if parent_m.keys != nil { return nil, nil @@ -297,7 +298,7 @@ func (m model_ca) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } if parent_m.keys != nil { return model{list: parent_m.list}, tea.ClearScreen - } else { + } else { m.quitting = true return m, tea.Quit } @@ -315,9 +316,11 @@ func (m model_ca) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, nil } if parent_m.keys != nil { + tempAuthorToggle = false return model{list: parent_m.list}, tea.ClearScreen } else { m.quitting = true + tempAuthorToggle = false return m, tea.Quit } }