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

Commit f7e42eb

Browse files
Disabling caching for the repository clone view
1 parent ade3b5f commit f7e42eb

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

src/GitHub.App/SampleData/Dialog/Clone/SelectPageViewModelDesigner.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public SelectPageViewModelDesigner()
4141
public ICollectionView ItemsView { get; }
4242
public IRepositoryItemViewModel SelectedItem { get; set; }
4343
public RepositoryModel Repository { get; }
44-
public ReactiveCommand<Unit, Unit> Refresh { get; }
4544

4645
public void Initialize(IConnection connection)
4746
{

src/GitHub.App/ViewModels/Dialog/Clone/RepositorySelectViewModel.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public class RepositorySelectViewModel : ViewModelBase, IRepositorySelectViewMod
3535
ICollectionView itemsView;
3636
ObservableAsPropertyHelper<RepositoryModel> repository;
3737
IRepositoryItemViewModel selectedItem;
38-
static bool firstLoad = true;
3938

4039
[ImportingConstructor]
4140
public RepositorySelectViewModel(IRepositoryCloneService service, IGitHubContextService gitHubContextService)
@@ -58,12 +57,6 @@ public RepositorySelectViewModel(IRepositoryCloneService service, IGitHubContext
5857
.ToProperty(this, x => x.Repository);
5958

6059
this.WhenAnyValue(x => x.Filter).Subscribe(_ => ItemsView?.Refresh());
61-
62-
Refresh = ReactiveCommand.CreateFromTask(async () =>
63-
{
64-
await this.LoadItems(true);
65-
return Unit.Default;
66-
});
6760
}
6861

6962
public Exception Error
@@ -108,8 +101,6 @@ public IRepositoryItemViewModel SelectedItem
108101
set => this.RaiseAndSetIfChanged(ref selectedItem, value);
109102
}
110103

111-
public ReactiveCommand<Unit, Unit> Refresh { get; }
112-
113104
public RepositoryModel Repository => repository.Value;
114105

115106
public void Initialize(IConnection connection)
@@ -122,8 +113,7 @@ public void Initialize(IConnection connection)
122113

123114
public async Task Activate()
124115
{
125-
await this.LoadItems(firstLoad);
126-
firstLoad = false;
116+
await this.LoadItems(true);
127117
}
128118

129119
static string GroupName(KeyValuePair<string, IReadOnlyList<RepositoryListItemModel>> group, int max)

src/GitHub.Exports.Reactive/ViewModels/Dialog/Clone/IRepositorySelectViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public interface IRepositorySelectViewModel : IRepositoryCloneTabViewModel
1616
IReadOnlyList<IRepositoryItemViewModel> Items { get; }
1717
ICollectionView ItemsView { get; }
1818
IRepositoryItemViewModel SelectedItem { get; set; }
19-
ReactiveCommand<Unit, Unit> Refresh { get; }
2019

2120
void Initialize(IConnection connection);
2221
}

src/GitHub.VisualStudio.UI/Views/Dialog/Clone/SelectPageView.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
</UserControl.Resources>
2222

2323
<DockPanel>
24-
<DockPanel DockPanel.Dock="Top" Margin="0,4">
25-
<Button DockPanel.Dock="Right" Command="{Binding Refresh}">Refresh</Button>
26-
<ghfvs:PromptTextBox PromptText="Search or enter a URL"
27-
Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged, Delay=300}"/>
28-
</DockPanel>
24+
<ghfvs:PromptTextBox DockPanel.Dock="Top"
25+
Margin="0,4"
26+
PromptText="Search or enter a URL"
27+
Text="{Binding Filter, UpdateSourceTrigger=PropertyChanged, Delay=300}"/>
28+
2929
<Grid>
3030
<ListView BorderThickness="0"
3131
ItemsSource="{Binding ItemsView}"

0 commit comments

Comments
 (0)