From 5e27376af43074df638cfa6494151ef19a1e3c6a Mon Sep 17 00:00:00 2001 From: Nicolas Martin Date: Wed, 4 Nov 2020 18:13:59 +0100 Subject: [PATCH] Keep displaying local markdowns after stashing & deleting them --- ui/stash.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/stash.go b/ui/stash.go index cd8f78a..011e102 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -636,10 +636,11 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) { // back to a local file. md.markdownType = localMarkdown md.Note = m.markdowns[i].displayPath + } else { + // Delete optimistically and remove the stashed item + // before we've received a success response. + m.markdowns = append(m.markdowns[:i], m.markdowns[i+1:]...) } - // Delete optimistically and remove the stashed item - // before we've received a success response. - m.markdowns = append(m.markdowns[:i], m.markdowns[i+1:]...) } // Set state and delete