diff --git a/apps/staking/src/pages/blocks/[[...block]].tsx b/apps/staking/src/pages/blocks/[[...block]].tsx index 4ce32849..1ca6fd8f 100644 --- a/apps/staking/src/pages/blocks/[[...block]].tsx +++ b/apps/staking/src/pages/blocks/[[...block]].tsx @@ -123,8 +123,7 @@ const Blocks: FC = ({ chainId }) => { // TODO: use blockId blockId = blockId && blockId.length > 0 ? (blockId[0] as string) : ''; - const [searchKey, setSearchKey] = useState(blockId); - const [debouncedSearchKey, setDebouncedSearchKey] = useState(searchKey); + const [debouncedSearchKey, setDebouncedSearchKey] = useState(blockId); // list of all blocks, unfiltered const all = useBlocks(undefined, 20); @@ -155,7 +154,6 @@ const Blocks: FC = ({ chainId }) => { onSearchChange={(e) => { const nextValue = e.target.value; debounced(nextValue); - setSearchKey(nextValue); }} /> @@ -164,7 +162,7 @@ const Blocks: FC = ({ chainId }) => { - {!searchKey && ( + {!debouncedSearchKey && ( = ({ chainId }) => { chainId={chainId} result={byProducer} filterField="producer" - filterValue={searchKey} + filterValue={debouncedSearchKey} w="100%" px="6vw" py="5" @@ -188,7 +186,7 @@ const Blocks: FC = ({ chainId }) => { chainId={chainId} result={byNode} filterField="node" - filterValue={searchKey} + filterValue={debouncedSearchKey} w="100%" px="6vw" py="5"