diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx index 6508e37081..38ac14cd6d 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx @@ -37,7 +37,8 @@ export const FileExplorer = (props: FileExplorerProps) => { fileState, canPaste, feTarget, - setFeTarget + setFeTarget, + setHasCopied } = props const [state, setState] = useState(workspaceState) // const [isPending, startTransition] = useTransition(); @@ -208,8 +209,10 @@ export const FileExplorer = (props: FileExplorerProps) => { if (feTarget?.length > 0 && feTarget[0]?.key.length > 0) { if (feTarget?.length > 1) { handleMultiCopies(feTarget) + setHasCopied(false) } else { handleCopyClick(feTarget[0].key, feTarget[0].type) + setHasCopied(false) } } } @@ -221,6 +224,7 @@ export const FileExplorer = (props: FileExplorerProps) => { setCutActivated(true) } else { handleCopyClick(feTarget[0].key, feTarget[0].type) + setCutActivated(true) } } } @@ -232,8 +236,10 @@ export const FileExplorer = (props: FileExplorerProps) => { const promisesToKeep = state.copyElement.filter(x => x).map(async (item) => { if (item.type === 'file') { props.dispatchMoveFile(item.key, feTarget[0].key) + setCutActivated(false) } else { props.dispatchMoveFolder(item.key, feTarget[0].key) + setCutActivated(false) } }) await Promise.all(promisesToKeep) @@ -243,8 +249,10 @@ export const FileExplorer = (props: FileExplorerProps) => { setState((prev) => { return { ...prev, copyElement: []} }) + setCutActivated(false) } else { props.dispatchMoveFolder(state.copyElement[0]?.key, feTarget[0].key) + setCutActivated(false) } } } else { diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 585005b123..6a7da22b21 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -1110,6 +1110,8 @@ export function Workspace() { importFromIpfs={importFromUrl} importFromHttps={importFromUrl} canPaste={canPaste} + hasCopied={hasCopied} + setHasCopied={setHasCopied} /> )} @@ -1183,6 +1185,8 @@ export function Workspace() { dragStatus={dragStatus} importFromIpfs={importFromUrl} importFromHttps={importFromUrl} + hasCopied={hasCopied} + setHasCopied={setHasCopied} /> )} diff --git a/libs/remix-ui/workspace/src/lib/types/index.ts b/libs/remix-ui/workspace/src/lib/types/index.ts index 17a1db53d7..9f21c799bf 100644 --- a/libs/remix-ui/workspace/src/lib/types/index.ts +++ b/libs/remix-ui/workspace/src/lib/types/index.ts @@ -166,6 +166,8 @@ export interface FileExplorerProps { type: "file" | "folder"; }[]>> publishManyFilesToGist: () => Promise + hasCopied: boolean + setHasCopied: Dispatch> } export interface FileExplorerMenuProps {