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

Commit 71a9595

Browse files
committed
Fix silly code
1 parent 4d99b91 commit 71a9595

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
@@ -64,17 +64,11 @@ public RepositoryCreationViewModel(
6464
accounts = repositoryHost.ModelService.GetAccounts()
6565
.ObserveOn(RxApp.MainThreadScheduler)
6666
.ToProperty(this, vm => vm.Accounts, initialValue: new ReadOnlyCollection<IAccount>(new IAccount[] {}));
67-
67+
6868
this.WhenAny(x => x.Accounts, x => x.Value)
69+
.Select(accts => accts?.FirstOrDefault())
6970
.WhereNotNull()
70-
.Where(accts => accts.Any())
71-
.Subscribe(accts => {
72-
var selectedAccount = accts.FirstOrDefault();
73-
if (selectedAccount != null)
74-
{
75-
SelectedAccount = accts.FirstOrDefault();
76-
}
77-
});
71+
.Subscribe(a => SelectedAccount = a);
7872

7973
browseForDirectoryCommand.Subscribe(_ => ShowBrowseForDirectoryDialog());
8074

0 commit comments

Comments
 (0)