Procházet zdrojové kódy

fix toggle private

AykutSarac před 2 roky
rodič
revize
6c270635ac
1 změnil soubory, kde provedl 1 přidání a 2 odebrání
  1. 1 2
      src/containers/Editor/BottomBar.tsx

+ 1 - 2
src/containers/Editor/BottomBar.tsx

@@ -78,8 +78,6 @@ export const BottomBar = () => {
   const [isPrivate, setIsPrivate] = React.useState(true);
   const [isPrivate, setIsPrivate] = React.useState(true);
 
 
   React.useEffect(() => {
   React.useEffect(() => {
-    console.log(data);
-
     setIsPrivate(data?.data.private ?? true);
     setIsPrivate(data?.data.private ?? true);
   }, [data]);
   }, [data]);
 
 
@@ -107,6 +105,7 @@ export const BottomBar = () => {
 
 
   const setPrivate = () => {
   const setPrivate = () => {
     if (!query.json) return handleSaveJson();
     if (!query.json) return handleSaveJson();
+    setIsPrivate(!isPrivate);
     updateJson(query.json as string, { private: !isPrivate });
     updateJson(query.json as string, { private: !isPrivate });
   };
   };