Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 3b688f8

Browse files
committed
Only update PR list state on main thread.
`IVirtualizingListSource.IsLoading` can be signalled on a background thread. This was causing a deadlock in #1828. Make sure we call `IssueListViewModelBase.UpdateState` on the UI thread. Fixes #1828
1 parent ea714ae commit 3b688f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/GitHub.App/ViewModels/GitHubPane/IssueListViewModelBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Reactive.Disposables;
88
using System.Reactive.Linq;
99
using System.Threading.Tasks;
10+
using System.Windows.Threading;
1011
using GitHub.Collections;
1112
using GitHub.Extensions;
1213
using GitHub.Extensions.Reactive;
@@ -209,6 +210,7 @@ public override Task Refresh()
209210
this.WhenAnyValue(x => x.SelectedState),
210211
this.WhenAnyValue(x => x.AuthorFilter.Selected),
211212
(loading, count, _, __, ___) => Tuple.Create(loading, count))
213+
.ObserveOn(RxApp.MainThreadScheduler)
212214
.Subscribe(x => UpdateState(x.Item1, x.Item2)));
213215
dispose.Add(
214216
Observable.FromEventPattern<ErrorEventArgs>(

0 commit comments

Comments
 (0)