From 025dcee3da8e4a2e5cf46bf2acb5eca4fa591940 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 18 Dec 2020 15:59:49 -0500 Subject: [PATCH] Fix case where stashDocument could erroneously return a command in a command --- ui/ui.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/ui.go b/ui/ui.go index e281fa5..3f1417b 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -647,13 +647,11 @@ func saveDocumentNote(cc *charm.Client, id int, note string) tea.Cmd { func stashDocument(cc *charm.Client, md markdown) tea.Cmd { return func() tea.Msg { if cc == nil { - return func() tea.Msg { - err := errors.New("can't stash; no charm client") - if debug { - log.Println("error stashing document:", err) - } - return stashFailMsg{err, md} + err := errors.New("can't stash; no charm client") + if debug { + log.Println("error stashing document:", err) } + return stashFailMsg{err, md} } // Is the document missing a body? If so, it likely means it needs to