fix fe copy previous bug

pull/5062/head
Joseph Izang 3 months ago committed by Aniket
parent 3f476d2a41
commit 5ec8e4721f
  1. 5
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
  2. 2
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
  3. 1
      libs/remix-ui/workspace/src/lib/types/index.ts

@ -35,8 +35,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
uploadFile,
uploadFolder,
fileState,
canPaste,
hasCopied
canPaste
} = props
const [state, setState] = useState<WorkSpaceState>(workspaceState)
// const [isPending, startTransition] = useTransition();
@ -287,7 +286,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
targetDocument?.removeEventListener('keydown', CopyComboHandler)
}
}
}, [treeRef.current, feTarget, canPaste, state.copyElement.length, hasCopied])
}, [treeRef.current, feTarget, feTarget.length, canPaste, state.copyElement, state.copyElement.length])
const hasReservedKeyword = (content: string): boolean => {
if (state.reservedKeywords.findIndex((value) => content.startsWith(value)) !== -1) return true

@ -1075,7 +1075,6 @@ export function Workspace() {
importFromIpfs={importFromUrl}
importFromHttps={importFromUrl}
canPaste={canPaste}
hasCopied={hasCopied}
/>
)}
@ -1094,7 +1093,6 @@ export function Workspace() {
flatTree={global.fs.localhost.flatTree}
fileState={[]}
canPaste={canPaste}
hasCopied={hasCopied}
workspaceState={state}
expandPath={global.fs.localhost.expandPath}
focusEdit={global.fs.focusEdit}

@ -102,7 +102,6 @@ export interface FileExplorerProps {
name: string,
menuItems?: string[],
canPaste: boolean
hasCopied: boolean
contextMenuItems: MenuItems,
removedContextMenuItems: MenuItems,
files: { [x: string]: Record<string, FileType> },

Loading…
Cancel
Save