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

Commit 3654a52

Browse files
authored
Merge pull request #1065 from github/fixes/1064-clone-crash
Prevent threading error when cloning.
2 parents 16b867e + 92f5f95 commit 3654a52

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/GitHub.App/ViewModels/RepositoryCloneViewModel.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,17 @@ public override void Initialize([AllowNull] ViewWithData data)
125125

126126
IsBusy = true;
127127
repositoryHost.ModelService.GetRepositories(repositories);
128-
repositories.OriginalCompleted.Subscribe(
129-
_ => { }
130-
, ex =>
131-
{
132-
LoadingFailed = true;
133-
IsBusy = false;
134-
log.Error("Error while loading repositories", ex);
135-
},
136-
() => IsBusy = false
128+
repositories.OriginalCompleted
129+
.ObserveOn(RxApp.MainThreadScheduler)
130+
.Subscribe(
131+
_ => { }
132+
, ex =>
133+
{
134+
LoadingFailed = true;
135+
IsBusy = false;
136+
log.Error("Error while loading repositories", ex);
137+
},
138+
() => IsBusy = false
137139
);
138140
repositories.Subscribe();
139141
}

0 commit comments

Comments
 (0)