mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-13 22:17:05 +02:00
use gui.g directly
This commit is contained in:
parent
7db1fee877
commit
68d5c2bc10
@ -620,15 +620,14 @@ func (gui *Gui) goEvery(interval time.Duration, function func() error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) startBackgroundFetch() {
|
func (gui *Gui) startBackgroundFetch() {
|
||||||
g := gui.g
|
|
||||||
gui.waitForIntro.Wait()
|
gui.waitForIntro.Wait()
|
||||||
isNew := gui.Config.GetIsNewRepo()
|
isNew := gui.Config.GetIsNewRepo()
|
||||||
if !isNew {
|
if !isNew {
|
||||||
time.After(60 * time.Second)
|
time.After(60 * time.Second)
|
||||||
}
|
}
|
||||||
_, err := gui.fetch(g, g.CurrentView(), false)
|
_, err := gui.fetch(gui.g, gui.g.CurrentView(), false)
|
||||||
if err != nil && strings.Contains(err.Error(), "exit status 128") && isNew {
|
if err != nil && strings.Contains(err.Error(), "exit status 128") && isNew {
|
||||||
_ = gui.createConfirmationPanel(g, g.CurrentView(), gui.Tr.SLocalize("NoAutomaticGitFetchTitle"), gui.Tr.SLocalize("NoAutomaticGitFetchBody"), nil, nil)
|
_ = gui.createConfirmationPanel(gui.g, gui.g.CurrentView(), gui.Tr.SLocalize("NoAutomaticGitFetchTitle"), gui.Tr.SLocalize("NoAutomaticGitFetchBody"), nil, nil)
|
||||||
} else {
|
} else {
|
||||||
gui.goEvery(time.Second*60, func() error {
|
gui.goEvery(time.Second*60, func() error {
|
||||||
_, err := gui.fetch(gui.g, gui.g.CurrentView(), false)
|
_, err := gui.fetch(gui.g, gui.g.CurrentView(), false)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user