1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-07 22:02:56 +03:00
The waiting status shouldn't happen until after the user has responded
to the popup.

Since we're not giving a standalone prompt about clearing the patch, all
of the business in `discard` doesn't need to be in a function any more
This commit is contained in:
Aaron Hoffman
2024-01-29 22:44:21 -06:00
parent 15d5261933
commit 62a0c895b4

View File

@@ -186,15 +186,13 @@ func (self *CommitFilesController) discard(selectedNodes []*filetree.CommitFileN
return err
}
removeFileRange := func() error {
return self.c.WithWaitingStatus(self.c.Tr.RebasingStatus, func(gocui.Task) error {
selectedNodes = normalisedSelectedCommitFileNodes(selectedNodes)
return self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.DiscardFileChangesTitle,
Prompt: self.c.Tr.DiscardFileChangesPrompt,
HandleConfirm: func() error {
return self.c.WithWaitingStatus(self.c.Tr.RebasingStatus, func(gocui.Task) error {
var filePaths []string
selectedNodes = normalisedSelectedCommitFileNodes(selectedNodes)
// Reset the current patch if there is one.
if self.c.Git().Patch.PatchBuilder.Active() {
@@ -220,12 +218,9 @@ func (self *CommitFilesController) discard(selectedNodes []*filetree.CommitFileN
}
return self.c.Refresh(types.RefreshOptions{Mode: types.BLOCK_UI})
})
},
})
})
}
return removeFileRange()
}
func (self *CommitFilesController) open(node *filetree.CommitFileNode) error {