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

Commit d617896

Browse files
author
Dan Walmsley
committed
Corrected logic for filterTextEnabled observable.
1 parent 389d41f commit d617896

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/GitHub.App/ViewModels/RepositoryCloneViewModel.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ public RepositoryCloneViewModel(
7575
repositories.Filter = FilterRepository;
7676
repositories.NewerComparer = OrderedComparer<IRemoteRepositoryModel>.OrderByDescending(x => x.UpdatedAt).Compare;
7777

78-
filterTextIsEnabled = this.WhenAny(x => x.IsLoading, x => x.LoadingFailed,
79-
(loading, loadingFailed) => !loadingFailed.Value)
80-
.Select(x => x || repositories.UnfilteredCount > 0)
81-
.ToProperty(this, x => x.FilterTextIsEnabled, initialValue: true);
78+
filterTextIsEnabled = this.WhenAny(x => x.IsLoading,
79+
(loading) => loading.Value || repositories.UnfilteredCount > 0 && !LoadingFailed)
80+
.ToProperty(this, x => x.FilterTextIsEnabled);
8281

83-
this.WhenAny(x => x.FilterTextIsEnabled, x => x.IsLoading, x => x.LoadingFailed,
84-
(any, loading, failed) => !loading.Value && !failed.Value && repositories.UnfilteredCount == 0)
82+
this.WhenAny(x => x.IsLoading, x => x.LoadingFailed,
83+
(loading, failed) => !loading.Value && !failed.Value && repositories.UnfilteredCount == 0)
8584
.Subscribe(x => NoRepositoriesFound = x);
8685

8786
this.WhenAny(x => x.FilterText, x => x.Value)

0 commit comments

Comments
 (0)