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

Commit 473d077

Browse files
committed
Fix threading in RepositoryHosts log in/out.
Make sure the observables are signalled on the UI thread.
1 parent abedf7a commit 473d077

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/GitHub.App/Models/RepositoryHosts.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ public IObservable<AuthenticationResult> LogInFromCache(HostAddress address)
180180
var host = await RepositoryHostFactory.Create(address);
181181
return host.LogInFromCache()
182182
.Catch<AuthenticationResult, Exception>(Observable.Throw<AuthenticationResult>)
183+
.ObserveOn(RxApp.MainThreadScheduler)
183184
.Do(result =>
184185
{
185186
bool successful = result.IsSuccess();
@@ -199,6 +200,7 @@ public IObservable<Unit> LogOut(IRepositoryHost host)
199200
var address = host.Address;
200201
var isDotCom = HostAddress.GitHubDotComHostAddress == address;
201202
return host.LogOut()
203+
.ObserveOn(RxApp.MainThreadScheduler)
202204
.Do(result =>
203205
{
204206
// reset the logged out host property to null

0 commit comments

Comments
 (0)