Skip to content

Commit

Permalink
Improve search functionality and pagination reset
Browse files Browse the repository at this point in the history
The search box now clears when a different system is selected, enhancing the app's usability. Additionally, the pagination reset action has been moved to trigger at the start of the LoadGameFiles function. This change allows for better reliability and consistency in user interactions, as the search function no longer handles the pagination reset.
  • Loading branch information
drpetersonfernandes committed Mar 19, 2024
1 parent 0ac3116 commit f3d1d27
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions SimpleLauncher/MainWindow.xaml.cs
Expand Up @@ -179,6 +179,7 @@ private void MainWindow_Restart()

private void SystemComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SearchTextBox.Text = "";
EmulatorComboBox.ItemsSource = null;
EmulatorComboBox.SelectedIndex = -1;

Expand Down Expand Up @@ -256,6 +257,9 @@ private void EmulatorComboBox_SelectionChanged(object sender, SelectionChangedEv

private async Task LoadGameFiles(string startLetter = null, string searchQuery = null)
{
// Ensure pagination is reset at the beginning
ResetPaginationButtons();

try
{
GameFileGrid.Children.Clear();
Expand Down Expand Up @@ -493,9 +497,6 @@ public static async void HandleError(Exception ex, string message)

private async void SearchButton_Click(object sender, RoutedEventArgs e)
{
// Reset pagination controls
ResetPaginationButtons();

var searchQuery = SearchTextBox.Text.Trim();

if (SystemComboBox.SelectedItem == null)
Expand Down

0 comments on commit f3d1d27

Please sign in to comment.