Skip to content
Snippets Groups Projects
Commit a1097288 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

reset the pin numbers before search results are fetch (so the results will be...

reset the pin numbers before search results are fetch (so the results will be restarted from beginning)
parent b43cf7cf
No related branches found
No related tags found
2 merge requests!223reset the pin numbers before search results are fetch (so the results will be...,!207Resolve "Reported number of pins are wrong"
Pipeline #92360 passed
......@@ -17,6 +17,7 @@ import { useRouter } from 'next/router';
import { ChangeEvent, KeyboardEvent, useCallback, useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { ONE, ZERO } from '@/constants/common';
import { clearEntityNumberData } from '@/redux/entityNumber/entityNumber.slice';
import { getDefaultSearchTab, getSearchValuesArrayAndTrimToSeven } from './SearchBar.utils';
const ENTER_KEY_CODE = 'Enter';
......@@ -72,6 +73,7 @@ export const SearchBar = (): JSX.Element => {
const searchValues = getSearchValuesArrayAndTrimToSeven(searchValue);
if (event.code === ENTER_KEY_CODE) {
dispatch(clearEntityNumberData());
dispatch(resetReactionsData());
dispatch(getSearchData({ searchQueries: searchValues, isPerfectMatch }));
openSearchDrawerIfClosed(getDefaultSearchTab(searchValues));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment