Skip to content

Commit

Permalink
Don't show "no results" when no search was performed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissawyerfan4 committed Mar 4, 2023
1 parent e902e7c commit 6da9c0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/App/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function getSearch(): View
'only_lists' => '',
'only_tags' => '',
'order_by' => $this->orderByOptions[0],
'performed_search' => false,
]);
}

Expand Down Expand Up @@ -60,6 +61,7 @@ public function doSearch(SearchRequest $request): View
'empty_tags' => $this->emptyTags,
'empty_lists' => $this->emptyLists,
'order_by' => $this->searchOrderBy,
'performed_search' => true,
]);
}
}
8 changes: 5 additions & 3 deletions resources/views/app/search/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ class="form-check-input"
<div class="card-table mt-4">

@if($results->isEmpty())
<div class="alert alert-info m-3">
@lang('search.no_results')
</div>
@if($query_settings['performed_search'])
<div class="alert alert-info m-3">
@lang('search.no_results')
</div>
@endif
@else
@include('app.search.partials.table', ['results' => $results])
@endif
Expand Down

0 comments on commit 6da9c0a

Please sign in to comment.