diff options
Diffstat (limited to 'pkg/gui/app_status_manager.go')
-rw-r--r-- | pkg/gui/app_status_manager.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/app_status_manager.go b/pkg/gui/app_status_manager.go index 39f2940e2..a613f5adb 100644 --- a/pkg/gui/app_status_manager.go +++ b/pkg/gui/app_status_manager.go @@ -50,14 +50,14 @@ func (m *statusManager) getStatusString() string { // WithWaitingStatus wraps a function and shows a waiting status while the function is still executing func (gui *Gui) WithWaitingStatus(name string, f func() error) error { - go func() { + go utils.Safe(func() { gui.statusManager.addWaitingStatus(name) defer func() { gui.statusManager.removeStatus(name) }() - go func() { + go utils.Safe(func() { ticker := time.NewTicker(time.Millisecond * 50) defer ticker.Stop() for range ticker.C { @@ -67,14 +67,14 @@ func (gui *Gui) WithWaitingStatus(name string, f func() error) error { } gui.renderString("appStatus", appStatus) } - }() + }) if err := f(); err != nil { gui.g.Update(func(g *gocui.Gui) error { return gui.surfaceError(err) }) } - }() + }) return nil } |