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

Commit f83e50d

Browse files
committed
Fix silly code
1 parent a3f61e7 commit f83e50d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/GitHub.App/ViewModels/RepositoryCreationViewModel.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,11 @@ public RepositoryCreationViewModel(
6767
accounts = repositoryHost.ModelService.GetAccounts()
6868
.ObserveOn(RxApp.MainThreadScheduler)
6969
.ToProperty(this, vm => vm.Accounts, initialValue: new ReadOnlyCollection<IAccount>(new IAccount[] {}));
70-
70+
7171
this.WhenAny(x => x.Accounts, x => x.Value)
72+
.Select(accts => accts?.FirstOrDefault())
7273
.WhereNotNull()
73-
.Where(accts => accts.Any())
74-
.Subscribe(accts => {
75-
var selectedAccount = accts.FirstOrDefault();
76-
if (selectedAccount != null)
77-
{
78-
SelectedAccount = accts.FirstOrDefault();
79-
}
80-
});
74+
.Subscribe(a => SelectedAccount = a);
8175

8276
browseForDirectoryCommand.Subscribe(_ => ShowBrowseForDirectoryDialog());
8377

0 commit comments

Comments
 (0)