Преглед изворни кода

fix(search): fix default params

lind пре 3 година
родитељ
комит
effcabf2cc
1 измењених фајлова са 4 додато и 2 уклоњено
  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(() => {