Explorar el Código

imprv tyming of setScopeChildren

kaori hace 3 años
padre
commit
27d247995c
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      packages/app/src/components/Navbar/GlobalSearch.tsx

+ 3 - 3
packages/app/src/components/Navbar/GlobalSearch.tsx

@@ -44,15 +44,15 @@ export const GlobalSearch = (props: GlobalSearchProps): JSX.Element => {
   const [isFocused, setFocused] = useState<boolean>(false);
 
   useEffect(() => {
-    setScopeChildren(isSearchScopeChildrenAsDefault || false);
+    if (isSearchScopeChildrenAsDefault !== undefined) {
+      setScopeChildren(isSearchScopeChildrenAsDefault || false);
+    }
   }, [isSearchScopeChildrenAsDefault]);
 
   const isLoadingIsSearchScopeChildrenAsDefault = useMemo(() => {
     return isSearchScopeChildrenAsDefault === undefined;
   }, [isSearchScopeChildrenAsDefault]);
 
-  console.log({ isLoadingIsSearchScopeChildrenAsDefault });
-
 
   const gotoPage = useCallback((data: IPageWithSearchMeta[]) => {
     assert(data.length > 0);