Explorar el Código

fix(search): fix default params

lind hace 3 años
padre
commit
effcabf2cc
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      src/components/SearchComponent/index.tsx

+ 4 - 2
src/components/SearchComponent/index.tsx

@@ -522,8 +522,10 @@ const SearchComponent = <T extends Record<string, any>>(props: Props<T>) => {
   };
 
   useEffect(() => {
-    form.setValues(JSON.parse(url.q));
-    handleSearch();
+    if (url.q) {
+      form.setValues(JSON.parse(url.q));
+      handleSearch();
+    }
   }, [url]);
 
   useEffect(() => {