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

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

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

Loading…
Cancel
Save