Fetch PRs after checkout (not blocking UI)

If you check out a new branch via the remote branches tab you'd want to
see its status
This commit is contained in:
Jesse Duffield 2026-02-08 10:14:14 +11:00
parent 658dbd2bdf
commit 3b677cbcfe

View file

@ -66,6 +66,11 @@ func (self *RefsHelper) CheckoutRef(ref string, options types.CheckoutRefOptions
types.STATUS,
types.BISECT_INFO,
types.STAGING,
}, Then: func() {
// Fetch PRs in the background after checkout; the new branch may
// have a PR that we haven't fetched yet. We do this in Then so
// that branches are loaded first (PRs are matched against branches).
self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.PULL_REQUESTS}})
}})
}