From d5504fa5d0d4e0312e1b27b8dbe3c6c664395a31 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 9 Apr 2021 00:33:39 +1000 Subject: potentially fix credentials issue --- pkg/gui/credentials_panel.go | 3 ++- pkg/gui/files_panel.go | 4 ++++ pkg/gui/layout.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/gui/credentials_panel.go b/pkg/gui/credentials_panel.go index 5911ddff0..ac162ae02 100644 --- a/pkg/gui/credentials_panel.go +++ b/pkg/gui/credentials_panel.go @@ -48,7 +48,7 @@ func (gui *Gui) handleSubmitCredential() error { return err } - return gui.refreshSidePanels(refreshOptions{}) + return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) } func (gui *Gui) handleCloseCredentialsView() error { @@ -78,6 +78,7 @@ func (gui *Gui) handleCredentialsPopup(cmdErr error) { if strings.Contains(errMessage, "Invalid username, password or passphrase") { errMessage = gui.Tr.PassUnameWrong } + _ = gui.returnFromContext() // we are not logging this error because it may contain a password or a passphrase _ = gui.createErrorPanel(errMessage) } else { diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index f2ed2f3a3..341849061 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -729,6 +729,10 @@ func (gui *Gui) pushFiles() error { // if we have pullables we'll ask if the user wants to force push currentBranch := gui.currentBranch() + if currentBranch == nil { + // need to wait for branches to refresh + return nil + } if currentBranch.Pullables == "?" { // see if we have this branch in our config with an upstream diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go index cdccb5b0f..29d75a1b5 100644 --- a/pkg/gui/layout.go +++ b/pkg/gui/layout.go @@ -355,10 +355,10 @@ func (gui *Gui) onInitialViewsCreation() error { // popups. Ordering within this layer does not matter because there should // only be one popup shown at a time gui.Views.CommitMessage, - gui.Views.Credentials, gui.Views.Menu, gui.Views.Suggestions, gui.Views.Confirmation, + gui.Views.Credentials, // this guy will cover everything else when it appears gui.Views.Limit, -- cgit v1.2.3