Przeglądaj źródła

simplified same codes

kaori 5 lat temu
rodzic
commit
79dd14d92c
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      src/client/js/components/CustomNavbar.jsx

+ 3 - 2
src/client/js/components/CustomNavbar.jsx

@@ -26,9 +26,10 @@ const CustomNavbar = (props) => {
     return min / max * 100;
   }
 
+  const random = Math.random().toString(32).substring(2);
 
-  const navTitleId = `custom-navtitle-${Math.random().toString(32).substring(2)}`;
-  const navTabId = `custom-navtab-${Math.random().toString(32).substring(2)}`;
+  const navTitleId = `custom-navtitle-${random}`;
+  const navTabId = `custom-navtab-${random}`;
 
   // [TODO: apply animation by gw4075]
   useEffect(() => {