1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Extract WaitingStatusHandle

This commit is contained in:
Stefan Haller
2023-09-20 08:08:14 +02:00
parent 05c32e292e
commit c222a618a8
2 changed files with 23 additions and 6 deletions

View File

@ -36,9 +36,7 @@ func (self *AppStatusHelper) Toast(message string) {
// withWaitingStatus wraps a function and shows a waiting status while the function is still executing
func (self *AppStatusHelper) WithWaitingStatus(message string, f func(gocui.Task) error) {
self.c.OnWorker(func(task gocui.Task) {
self.statusMgr().WithWaitingStatus(message, func() {
self.renderAppStatus()
self.statusMgr().WithWaitingStatus(message, self.renderAppStatus, func() {
if err := f(task); err != nil {
self.c.OnUIThread(func() error {
return self.c.Error(err)