1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-27 12:32:37 +02:00

fix another panic error

This commit is contained in:
Jesse Duffield 2020-10-07 22:21:15 +11:00
parent 777ec0b36c
commit 9011271a01
2 changed files with 8 additions and 3 deletions

View File

@ -485,7 +485,7 @@ func (gui *Gui) Run() error {
go utils.Safe(gui.startBackgroundFetch) 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())) g.SetManager(gocui.ManagerFunc(gui.layout), gocui.ManagerFunc(gui.getFocusLayout()))
@ -642,7 +642,7 @@ func (gui *Gui) startBackgroundFetch() {
prompt: gui.Tr.NoAutomaticGitFetchBody, prompt: gui.Tr.NoAutomaticGitFetchBody,
}) })
} else { } else {
gui.goEvery(time.Millisecond*50, gui.stopChan, func() error { gui.goEvery(time.Second*60, gui.stopChan, func() error {
err := gui.fetch(false) err := gui.fetch(false)
return err return err
}) })

View File

@ -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 { func (gui *Gui) handleRemoteEnter() error {