@@ -15,7 +15,7 @@ import { useQueryTableKeys } from 'app/hooks/useQueryTableKeys';
1515import { useSearchForm } from 'app/hooks/useSearchForm' ;
1616import { useSerilogUiProps } from 'app/hooks/useSerilogUiProps' ;
1717import { memo , useEffect } from 'react' ;
18- import { useController } from 'react-hook-form' ;
18+ import { useController , useWatch } from 'react-hook-form' ;
1919import classes from 'style/search.module.css' ;
2020import { LogLevel } from '../../../types/types' ;
2121
@@ -27,10 +27,11 @@ const levelsArray = Object.keys(LogLevel).map((level) => ({
2727const Search = ( { onRefetch } : { onRefetch ?: ( ) => void } ) => {
2828 const { isError } = useQueryTableKeys ( true ) ;
2929 const { isUtc, setIsUtc } = useSerilogUiProps ( ) ;
30- const { handleSubmit, reset, setValue, watch } = useSearchForm ( ) ;
30+ const { handleSubmit, reset, setValue } = useSearchForm ( ) ;
3131
3232 const { refetch } = useQueryLogs ( ) ;
33- const currentDbKey = watch ( 'table' ) ;
33+ const currentDbKey = useWatch ( { name : 'table' } ) ;
34+ const currentPage = useWatch ( { name : 'page' } ) ;
3435
3536 const clean = async ( ) => {
3637 reset ( ) ;
@@ -45,7 +46,7 @@ const Search = ({ onRefetch }: { onRefetch?: () => void }) => {
4546
4647 useEffect ( ( ) => {
4748 void refetch ( ) ;
48- } , [ currentDbKey , refetch ] ) ;
49+ } , [ currentDbKey , currentPage , refetch ] ) ;
4950
5051 return (
5152 < form aria-label = "search-logs-form" onSubmit = { ( ) => { } } >
0 commit comments