From cddd22029fb979def0167e1f854751422ac2cded Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 13 Dec 2023 19:51:14 +0800 Subject: [PATCH] bug fix --- src/_node/file/types.ts | 4 ---- .../workspaceTreeView/hooks/useNodeActionsHandler.ts | 8 +++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/_node/file/types.ts b/src/_node/file/types.ts index dd522fa1..f91c815d 100644 --- a/src/_node/file/types.ts +++ b/src/_node/file/types.ts @@ -71,10 +71,6 @@ export type TProjectLoaderResponse = { }; export type TFileApiPayloadBase = { - // addInvalidNodes: (...uids: string[]) => void; - // removeInvalidNodes: (...uids: string[]) => void; - // addTemporaryNodes: (...uids: string[]) => void; - // removeTemporaryNodes: (...uids: string[]) => void; projectContext: TProjectContext; action: TFileActionType; fileTree: TFileNodeTreeData; diff --git a/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts b/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts index 62991771..71ce8c19 100644 --- a/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts +++ b/src/components/main/actionsPanel/workspaceTreeView/hooks/useNodeActionsHandler.ts @@ -301,7 +301,9 @@ export const useNodeActionsHandler = ({ if (uids.length === 0) return; const message = `Are you sure you want to delete them? This action cannot be undone!`; - triggerAlert(message); + if (!window.confirm(message)) { + return; + } addRunningActions(["fileTreeView-delete"]); addInvalidNodes(...uids); @@ -325,10 +327,10 @@ export const useNodeActionsHandler = ({ removeInvalidNodes(...uids); removeRunningActions(["fileTreeView-delete"]); }, [ - addRunningActions, - removeRunningActions, selectedItems, invalidNodes, + addRunningActions, + removeRunningActions, addInvalidNodes, removeInvalidNodes, project,