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-07 18:09:33 +02:00
co-authored by Claude Sonnet 5
parent 21f1dc3366
commit ff7ecf2d2a
@@ -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)
}