Skip to content

Commit ecc66e9

Browse files
committed
updates: clear filter when checking updates for selected unity fixes #180, apply search filter after updates list is loaded
1 parent fffd6a3 commit ecc66e9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+14-1
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,11 @@ async Task CallGetUnityUpdates()
844844
updatesSource = items.ToArray();
845845
if (updatesSource == null) return;
846846
dataGridUpdates.ItemsSource = updatesSource;
847+
// if search string is set, then filter it (after data is loaded)
848+
if (string.IsNullOrEmpty(txtSearchBoxUpdates.Text) == false)
849+
{
850+
FilterUpdates();
851+
}
847852
}
848853

849854
async void GoLookForUpdatesForThisUnity()
@@ -857,7 +862,10 @@ async void GoLookForUpdatesForThisUnity()
857862
if (dataGridUpdates.ItemsSource != null)
858863
{
859864
tabControl.SelectedIndex = 2;
860-
txtSearchBoxUpdates.Text = ""; // need to clear old results first
865+
// need to clear old results first
866+
txtSearchBoxUpdates.Text = "";
867+
// reset filter
868+
rdoAll.IsChecked = true;
861869

862870
// NOTE for now, just set filter to current version, minus patch version "2021.1.7f1" > "2021.1"
863871
txtSearchBoxUpdates.Text = unity.Version.Substring(0, unity.Version.LastIndexOf('.'));
@@ -1168,6 +1176,11 @@ private async void OnTabSelectionChanged(object sender, SelectionChangedEventArg
11681176
updatesSource = items.ToArray();
11691177
if (updatesSource == null) return;
11701178
dataGridUpdates.ItemsSource = updatesSource;
1179+
// if search string is set, then filter it (after data is loaded)
1180+
if (string.IsNullOrEmpty(txtSearchBoxUpdates.Text) == false)
1181+
{
1182+
FilterUpdates();
1183+
}
11711184
}
11721185
}
11731186
}

0 commit comments

Comments
 (0)