fix: fix saerch query change on explore
Signed-off-by: Raul Kele <raulkeleblk@gmail.com>
This commit is contained in:
parent
a40801f75e
commit
c9c058a350
@ -96,7 +96,7 @@ const useStyles = makeStyles(() => ({
|
||||
}));
|
||||
|
||||
function SearchSuggestion() {
|
||||
const [queryParams] = useSearchParams();
|
||||
const [queryParams, setQueryParams] = useSearchParams();
|
||||
const search = queryParams.get('search');
|
||||
|
||||
const [searchQuery, setSearchQuery] = useState(search || '');
|
||||
@ -180,6 +180,7 @@ function SearchSuggestion() {
|
||||
};
|
||||
|
||||
const searchCall = (value) => {
|
||||
setQueryParams((prevState) => createSearchParams({ ...prevState, search: searchQuery }));
|
||||
if (value !== '') {
|
||||
// if search term inclused the ':' character, search for images, if not, search repos
|
||||
if (value?.includes(':')) {
|
||||
|
Loading…
Reference in New Issue
Block a user