Skip to content

Commit

Permalink
UILD-405: reduce timeout of the debounced input and show status messa…
Browse files Browse the repository at this point in the history
…ge after saving the record (#57)
  • Loading branch information
SKarolFolio authored Dec 17, 2024
1 parent 493c81e commit e1f5010
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/common/hooks/useFetchSearchData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const useFetchSearchData = () => {
precedingRecordsCount,
} = useSearchContext();
const { setIsLoading } = useLoadingState();
const { setMessage, data, setData, resetData, setPageMetadata } = useSearchState();
const { addStatusMessagesItem, resetStatusMessages } = useStatusState();
const { setMessage, resetMessage, data, setData, resetData, setPageMetadata } = useSearchState();
const { addStatusMessagesItem } = useStatusState();

const validateAndNormalizeQuery = useCallback(
(type: SearchIdentifiers, query: string) => {
Expand Down Expand Up @@ -133,7 +133,6 @@ export const useFetchSearchData = () => {
selectedSegment,
baseQuerySelector = SearchableIndexQuerySelector.Query,
}: FetchDataParams) => {
resetStatusMessages();
const selectedNavigationSegment = selectedSegment ?? navigationSegment?.value;

data && resetData();
Expand Down Expand Up @@ -176,6 +175,7 @@ export const useFetchSearchData = () => {

setData(content);
setPageMetadata({ totalPages, totalElements: totalRecords, prev, next });
resetMessage();
} catch {
addStatusMessagesItem?.(UserNotificationFactory.createMessage(StatusType.error, 'ld.errorFetching'));
} finally {
Expand Down
2 changes: 1 addition & 1 deletion src/components/EditSection/EditSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useInputsState, useProfileState, useStatusState, useUIState } from '@sr
import { renderDrawComponent } from './renderDrawComponent';
import './EditSection.scss';

const USER_INPUT_DELAY = 750;
const USER_INPUT_DELAY = 100;

export const EditSection = memo(() => {
const { selectedEntriesService } = useServicesContext() as Required<ServicesParams>;
Expand Down

0 comments on commit e1f5010

Please sign in to comment.