Fix being able to commit with an empty query and clearing the results

This commit is contained in:
DrabWeb 2017-06-08 06:31:37 -03:00
parent 70e12e5d9b
commit bb103d7878
1 changed files with 3 additions and 3 deletions

View File

@ -176,18 +176,18 @@ private void recreatePanels(PanelDisplayStyle displayStyle)
private string lastQuery = string.Empty;
private void updateSets()
{
if (!IsLoaded) return;
if (!IsLoaded || Header.Tabs.Current.Value == DirectTab.Search && Filter.Search.Text == string.Empty) return;
BeatmapSets = null;
ResultAmounts = null;
getSetsRequest?.Cancel();
if (api == null || Filter.Search.Text == string.Empty && Header.Tabs.Current.Value == DirectTab.Search) return;
if (api == null) return;
getSetsRequest = new GetBeatmapSetsRequest(lastQuery,
((FilterControl)Filter).Ruleset.Value,
Filter.DisplayStyleControl.Dropdown.Current.Value,
Filter.Tabs.Current.Value); //todo: sort direction
Filter.Tabs.Current.Value); //todo: sort direction (?)
getSetsRequest.Success += r =>
{