1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 12:25:22 +02:00

fix(wizard): debounce name state [EE-4177] (#8042)

move debouncing to the component (from the validation).
debounce returns undefined when it's not calling the debounced function,
and undefined is considered a validation error.
This commit is contained in:
Chaim Lev-Ari 2022-11-21 19:33:08 +02:00 committed by GitHub
parent 253a3a2b40
commit 7006c17ce4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 74 additions and 58 deletions

View file

@ -2,7 +2,7 @@ import { useState } from 'react';
import { useEnvironmentList } from '@/react/portainer/environments/queries/useEnvironmentList';
import { EdgeTypes, Environment } from '@/react/portainer/environments/types';
import { useDebounce } from '@/react/hooks/useDebounce';
import { useDebouncedValue } from '@/react/hooks/useDebouncedValue';
import { useSearchBarState } from '@@/datatables/SearchBar';
import {
@ -85,7 +85,7 @@ function Loader({ children, storageKey }: LoaderProps) {
});
const [search, setSearch] = useSearchBarState(storageKey);
const debouncedSearchValue = useDebounce(search);
const debouncedSearchValue = useDebouncedValue(search);
const { environments, isLoading, totalCount } = useEnvironmentList(
{