Skip to content

Commit

Permalink
Added minimum search query length
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed May 24, 2024
1 parent b038c0b commit f573418
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ReplayBrowser/Pages/Search.razor
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@
return;
}

// query cannot be empty and must be at least 3 characters
if (search.Length < 3)
{
ErrorMessage = "Query must be at least 3 characters long";
stopWatch.Stop();
return;
}

// convert mode to enum
// because we are using a human readable string, we can't use Enum.TryParse
var searchMode = SearchMode.PlayerOocName;
Expand Down

0 comments on commit f573418

Please sign in to comment.