From 14c8b80494a87b65580cff61d4af5f0c1bd33614 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 18 Sep 2020 07:54:42 +1000 Subject: [PATCH] show loading state when amending top commit --- pkg/gui/files_panel.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 2f44e566fdc..c2ec97e3b90 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -332,15 +332,17 @@ func (gui *Gui) handleAmendCommitPress() error { title: strings.Title(gui.Tr.SLocalize("AmendLastCommit")), prompt: gui.Tr.SLocalize("SureToAmend"), handleConfirm: func() error { - ok, err := gui.runSyncOrAsyncCommand(gui.GitCommand.AmendHead()) - if err != nil { - return err - } - if !ok { - return nil - } + return gui.WithWaitingStatus(gui.Tr.SLocalize("AmendingStatus"), func() error { + ok, err := gui.runSyncOrAsyncCommand(gui.GitCommand.AmendHead()) + if err != nil { + return err + } + if !ok { + return nil + } - return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) + return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) + }) }, }) }