mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Return error from RefreshOptions.Then
This commit is contained in:
parent
bbad3a70ce
commit
653994845e
6 changed files with 20 additions and 14 deletions
|
@ -76,7 +76,7 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
|
|||
)
|
||||
}
|
||||
|
||||
f := func() {
|
||||
f := func() error {
|
||||
var scopeSet *set.Set[types.RefreshableView]
|
||||
if len(options.Scope) == 0 {
|
||||
// not refreshing staging/patch-building unless explicitly requested because we only need
|
||||
|
@ -188,20 +188,22 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
|
|||
wg.Wait()
|
||||
|
||||
if options.Then != nil {
|
||||
options.Then()
|
||||
if err := options.Then(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
if options.Mode == types.BLOCK_UI {
|
||||
self.c.OnUIThread(func() error {
|
||||
f()
|
||||
return nil
|
||||
return f()
|
||||
})
|
||||
} else {
|
||||
f()
|
||||
return nil
|
||||
}
|
||||
|
||||
return nil
|
||||
return f()
|
||||
}
|
||||
|
||||
func getScopeNames(scopes []types.RefreshableView) []string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue