Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-706) Add a settings to prevent searchs preloading #740

Merged
merged 1 commit into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ public async Task LoadPackages()
return;
}

if (!_hasLoaded && _configService.GetAppConfiguration().PreventPreload)
{
_hasLoaded = true;
return;
}

_hasLoaded = false;

var sort = SortSelection == Resources.RemoteSourceViewModel_SortSelectionPopularity ? "DownloadCount" : "Title";
Expand Down
4 changes: 4 additions & 0 deletions Source/ChocolateyGui.Common/Models/AppConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public class AppConfiguration
[Feature]
public bool UseDelayedSearch { get; set; }

[LocalizedDescription("SettingsView_TogglePreventPreloadDescription")]
[Feature]
public bool PreventPreload { get; set; }

[LocalizedDescription("SettingsView_ToggleExcludeInstalledPackagesDescription")]
[Feature]
public bool ExcludeInstalledPackages { get; set; }
Expand Down
9 changes: 9 additions & 0 deletions Source/ChocolateyGui.Common/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Source/ChocolateyGui.Common/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@ NOTE: Probably only necessary to change in RTL languages.</comment>
<data name="SettingsView_ToggleShowAggregatedSourceViewDescription" xml:space="preserve">
<value>Show additional source combining all sources in one place.</value>
</data>
<data name="SettingsView_TogglePreventPreloadDescription" xml:space="preserve">
<value>Prevents preloading results with a blank search when opening the remote source view.</value>
</data>
<data name="SourcesView_AggregatedSourcesId" xml:space="preserve">
<value>All Sources</value>
</data>
Expand Down