Skip to content

Commit

Permalink
feat(ux): 🚸 hide start and continue results if searching for comm…
Browse files Browse the repository at this point in the history
…and (#112)
  • Loading branch information
JamesNZL committed Jul 8, 2023
1 parent 1a76c50 commit 00aa5d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TogglTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,11 @@ internal async ValueTask<List<Result>> _GetCommands(CancellationToken token, Que

private async ValueTask<List<Result>> _GetStartResults(CancellationToken token, Query query)
{
if (!string.IsNullOrEmpty(query.Search) && Settings.Commands.Any(command => command.StartsWith(query.Search)))
{
return Main.NoResults;
}

var me = (await this._GetMe(token))?.ToMe();
if (me is null)
{
Expand Down Expand Up @@ -1562,7 +1567,7 @@ out var stopTimeSpan

private async ValueTask<List<Result>> _GetContinueResults(CancellationToken token, Query query)
{
if (string.IsNullOrEmpty(query.Search))
if (string.IsNullOrEmpty(query.Search) || Settings.Commands.Any(command => command.StartsWith(query.Search)))
{
return Main.NoResults;
}
Expand Down

0 comments on commit 00aa5d6

Please sign in to comment.