From 9011271a014025c514adf72b1d1ee69fbc7f3373 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 7 Oct 2020 22:21:15 +1100 Subject: [PATCH] fix another panic error --- pkg/gui/gui.go | 4 ++-- pkg/gui/remotes_panel.go | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index e9c321949..d928413e7 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -485,7 +485,7 @@ func (gui *Gui) Run() error { go utils.Safe(gui.startBackgroundFetch) } - gui.goEvery(time.Millisecond*50, gui.stopChan, gui.refreshFilesAndSubmodules) + gui.goEvery(time.Second*10, gui.stopChan, gui.refreshFilesAndSubmodules) g.SetManager(gocui.ManagerFunc(gui.layout), gocui.ManagerFunc(gui.getFocusLayout())) @@ -642,7 +642,7 @@ func (gui *Gui) startBackgroundFetch() { prompt: gui.Tr.NoAutomaticGitFetchBody, }) } else { - gui.goEvery(time.Millisecond*50, gui.stopChan, func() error { + gui.goEvery(time.Second*60, gui.stopChan, func() error { err := gui.fetch(false) return err }) diff --git a/pkg/gui/remotes_panel.go b/pkg/gui/remotes_panel.go index 9d1450003..f3c984d78 100644 --- a/pkg/gui/remotes_panel.go +++ b/pkg/gui/remotes_panel.go @@ -58,7 +58,12 @@ func (gui *Gui) refreshRemotes() error { } } - return gui.postRefreshUpdate(gui.mustContextForContextKey(gui.getBranchesView().Context)) + branchesView := gui.getBranchesView() + if branchesView != nil { + return gui.postRefreshUpdate(gui.mustContextForContextKey(branchesView.Context)) + } + + return nil } func (gui *Gui) handleRemoteEnter() error {