Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public PullRequestListViewModel(
.Where(x => PullRequests != null)
.Subscribe(f => UpdateFilter(SelectedState, SelectedAssignee, SelectedAuthor, f));

this.WhenAnyValue(x => x.SelectedRepository)
.Skip(1)
.Subscribe(_ => ResetAndLoad());

OpenPullRequest = ReactiveCommand.Create();
OpenPullRequest.Subscribe(DoOpenPullRequest);
CreatePullRequest = ReactiveCommand.Create();
Expand Down Expand Up @@ -117,9 +121,9 @@ public async Task InitializeAsync(ILocalRepositoryModel repository, IConnection
new[] { remoteRepository.Parent, remoteRepository } :
new[] { remoteRepository };
SelectedState = States.FirstOrDefault(x => x.Name == listSettings.SelectedState) ?? States[0];

// Setting SelectedRepository will cause a Load().
SelectedRepository = Repositories[0];
WebUrl = repository.CloneUrl?.ToRepositoryUrl().Append("pulls");
await Load();
}
finally
{
Expand Down Expand Up @@ -321,6 +325,7 @@ void CreatePullRequests()

void ResetAndLoad()
{
WebUrl = SelectedRepository.CloneUrl?.ToRepositoryUrl().Append("pulls");
CreatePullRequests();
UpdateFilter(SelectedState, SelectedAssignee, SelectedAuthor, SearchQuery);
Load().Forget();
Expand Down