diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go index c39568cdf..d7be86857 100644 --- a/pkg/gui/patch_building_panel.go +++ b/pkg/gui/patch_building_panel.go @@ -82,7 +82,11 @@ func (gui *Gui) handleEscapePatchBuildingPanel() error { gui.GitCommand.PatchManager.Reset() } - return gui.switchContext(gui.Contexts.CommitFiles.Context) + if gui.currentContext().GetKey() == gui.Contexts.PatchBuilding.Context.GetKey() { + return gui.switchContext(gui.Contexts.CommitFiles.Context) + } + + return nil } func (gui *Gui) refreshSecondaryPatchPanel() error {