diff options
author | mjarkk <mkopenga@gmail.com> | 2018-12-07 14:56:29 +0100 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2018-12-07 14:56:29 +0100 |
commit | 8f904ffd720714fb315c69d1c44d6974842ab051 (patch) | |
tree | 7b1ee38a1c8483c5f894bc0353ed2a0ceb4f30d7 /pkg/gui/gui.go | |
parent | ced81e11f048a954b707996d78487e3a6cabd569 (diff) |
Working popup
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index e3d80df12..0004abf1b 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -371,8 +371,10 @@ func (gui *Gui) promptAnonymousReporting() error { }) } -func (gui *Gui) fetch(g *gocui.Gui, v *gocui.View, canSskForCredentials bool) error { - err := gui.GitCommand.Fetch(func(passOrUname string) string { +func (gui *Gui) fetch(g *gocui.Gui, v *gocui.View, canSskForCredentials bool) (unamePassOpend bool, err error) { + unamePassOpend = false + err = gui.GitCommand.Fetch(func(passOrUname string) string { + unamePassOpend = true return gui.waitForPassUname(gui.g, v, passOrUname) }, canSskForCredentials) @@ -386,7 +388,7 @@ func (gui *Gui) fetch(g *gocui.Gui, v *gocui.View, canSskForCredentials bool) er } gui.refreshStatus(g) - return err + return unamePassOpend, err } func (gui *Gui) updateLoader(g *gocui.Gui) error { @@ -442,12 +444,13 @@ func (gui *Gui) Run() error { } go func() { - err := gui.fetch(g, g.CurrentView(), false) + _, err := gui.fetch(g, g.CurrentView(), false) if err != nil && strings.Contains(err.Error(), "exit status 128") && gui.canShowIsPrivateRepo() { _ = gui.createConfirmationPanel(g, g.CurrentView(), gui.Tr.SLocalize("NoAutomaticGitFetchTitle"), gui.Tr.SLocalize("NoAutomaticGitFetchBody"), nil, nil) } else { gui.goEvery(g, time.Second*60, func(g *gocui.Gui) error { - return gui.fetch(g, g.CurrentView(), false) + _, err := gui.fetch(g, g.CurrentView(), false) + return err }) } }() |