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

Commit 86ce572

Browse files
authored
Merge pull request #768 from github/issue/766-fork-remote
Prevent race condition in PR details view.
2 parents 7af11cc + 29daf21 commit 86ce572

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/GitHub.App/ViewModels/PullRequestDetailViewModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public class PullRequestDetailViewModel : BaseViewModel, IPullRequestDetailViewM
4242
IPullRequestUpdateState updateState;
4343
string operationError;
4444
bool isFromFork;
45+
bool isInCheckout;
4546

4647
/// <summary>
4748
/// Initializes a new instance of the <see cref="PullRequestDetailViewModel"/> class.
@@ -90,6 +91,7 @@ public PullRequestDetailViewModel(
9091
.Select(x => x != null && x.DisabledMessage == null),
9192
DoCheckout);
9293
Checkout.ThrownExceptions.Subscribe(x => OperationError = x.Message);
94+
Checkout.IsExecuting.Subscribe(x => isInCheckout = x);
9395

9496
Pull = ReactiveCommand.CreateAsyncObservable(
9597
this.WhenAnyValue(x => x.UpdateState)
@@ -388,7 +390,10 @@ public async Task Load(IPullRequestModel pullRequest)
388390

389391
IsBusy = false;
390392

391-
pullRequestsService.RemoveUnusedRemotes(repository).Subscribe(_ => { });
393+
if (!isInCheckout)
394+
{
395+
pullRequestsService.RemoveUnusedRemotes(repository).Subscribe(_ => { });
396+
}
392397
}
393398

394399
/// <summary>

0 commit comments

Comments
 (0)