Bounce STASH model updates onto the UI thread

refreshStashEntries now loads the stash entries on the worker and writes
Model.StashEntries in an onUIThreadUnlessRepoChanged bounce.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Stefan Haller 2026-07-03 14:21:51 +02:00
parent 21f1dc3366
commit ff7ecf2d2a

View file

@ -979,9 +979,16 @@ func (self *RefreshHelper) refreshWorktrees() {
}
func (self *RefreshHelper) refreshStashEntries() {
self.c.Model().StashEntries = self.c.Git().Loaders.StashLoader.
generation := self.c.State().GetRepoGeneration()
stashEntries := self.c.Git().Loaders.StashLoader.
GetStashEntries(self.c.Modes().Filtering.GetPath())
self.onUIThreadUnlessRepoChanged(generation, func() error {
self.c.Model().StashEntries = stashEntries
return nil
})
self.refreshView(self.c.Contexts().Stash)
}