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

Commit 975a837

Browse files
author
Dan Walmsley
committed
Fix disable of filterbox when loading repos list on RepositoryClone dialog.
- Filterbox will be disabled if the loading fails, otherwise it will always be enabled.
1 parent 472dc0b commit 975a837

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/GitHub.App/ViewModels/RepositoryCloneViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +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.Value)
79-
.Select(x => !x && repositories.UnfilteredCount > 0)
80-
.ToProperty(this, x => x.FilterTextIsEnabled);
78+
filterTextIsEnabled = this.WhenAny(x => x.IsLoading, x => x.LoadingFailed,
79+
(loading, loadingFailed) => !loadingFailed.Value)
80+
.ToProperty(this, x => x.FilterTextIsEnabled, initialValue: true);
8181

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

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

0 commit comments

Comments
 (0)