Skip to content

Commit

Permalink
updates: clear filter when checking updates for selected unity fixes #…
Browse files Browse the repository at this point in the history
…180, apply search filter after updates list is loaded
  • Loading branch information
unitycoder committed Jan 9, 2025
1 parent fffd6a3 commit ecc66e9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion UnityLauncherPro/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,11 @@ async Task CallGetUnityUpdates()
updatesSource = items.ToArray();
if (updatesSource == null) return;
dataGridUpdates.ItemsSource = updatesSource;
// if search string is set, then filter it (after data is loaded)
if (string.IsNullOrEmpty(txtSearchBoxUpdates.Text) == false)
{
FilterUpdates();
}
}

async void GoLookForUpdatesForThisUnity()
Expand All @@ -857,7 +862,10 @@ async void GoLookForUpdatesForThisUnity()
if (dataGridUpdates.ItemsSource != null)
{
tabControl.SelectedIndex = 2;
txtSearchBoxUpdates.Text = ""; // need to clear old results first
// need to clear old results first
txtSearchBoxUpdates.Text = "";
// reset filter
rdoAll.IsChecked = true;

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

0 comments on commit ecc66e9

Please sign in to comment.