From e5144731da718fe4fa1f022e2ce6aeec8b62944a Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 14 Dec 2023 22:32:50 +0800 Subject: [PATCH] set LogAllow when console.log --- src/_node/node/actions.ts | 1 - .../workspaceTreeView/hooks/useFileOperations.ts | 3 ++- .../workspaceTreeView/hooks/useNodeActionsHandler.ts | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/_node/node/actions.ts b/src/_node/node/actions.ts index 884e5a0b..524f8d68 100644 --- a/src/_node/node/actions.ts +++ b/src/_node/node/actions.ts @@ -524,7 +524,6 @@ const ungroup = ({ }); addedChildCount[parentNode.uid] += containerNode.children.length - 1; }); - console.log(needToSelectNodePaths); return needToSelectNodePaths; })(); return needToSelectNodePaths; diff --git a/src/components/main/actionsPanel/workspaceTreeView/hooks/useFileOperations.ts b/src/components/main/actionsPanel/workspaceTreeView/hooks/useFileOperations.ts index 81a571c2..4d137994 100644 --- a/src/components/main/actionsPanel/workspaceTreeView/hooks/useFileOperations.ts +++ b/src/components/main/actionsPanel/workspaceTreeView/hooks/useFileOperations.ts @@ -12,6 +12,7 @@ import { deleteFileOrFolder, moveActions, } from "../helpers"; +import { LogAllow } from "@_constants/global"; interface IUseFileOperations { invalidNodes: { @@ -273,7 +274,7 @@ export const useFileOperations = ({ true, ); } catch (err) { - console.log(err); + LogAllow && console.log(err); } } else if (project.context === "idb") { await moveIDBFF(nodeData, targetNodeData, nodeData.name, true); diff --git a/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts b/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts index bc9b932a..4199e0cb 100644 --- a/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts +++ b/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts @@ -42,6 +42,7 @@ import { validateAndMoveNode, } from "../helpers"; import { callFileApi } from "@_node/apis"; +import { LogAllow } from "@_constants/global"; interface IUseNodeActionsHandler { invalidNodes: { @@ -320,12 +321,13 @@ export const useNodeActionsHandler = ({ uids, }, () => { - console.error("error while removing file system"); + LogAllow && console.error("error while removing file system"); }, (allDone: boolean) => { - console.log( - allDone ? "all is successfully removed" : "some is not removed", - ); + LogAllow && + console.log( + allDone ? "all is successfully removed" : "some is not removed", + ); }, ); removeInvalidNodes(...uids);