From 198a93d98e082b760f47b6a80e6891e876623258 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 15 Jul 2024 08:02:43 +0100 Subject: [PATCH] fixed comments --- .../workspace/src/lib/components/file-explorer.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 b3026ef6633..950c2810fff 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx @@ -40,6 +40,7 @@ export const FileExplorer = (props: FileExplorerProps) => { const { plugin } = useContext(FileSystemContext) const [feTarget, setFeTarget] = useState<{ key: string, type: 'file' | 'folder' }[]>({} as { key: string, type: 'file' | 'folder' }[]) const [filesSelected, setFilesSelected] = useState([]) + const feWindow = (window as any) useEffect(() => { if (contextMenuItems) { @@ -115,7 +116,7 @@ export const FileExplorer = (props: FileExplorerProps) => { if (treeRef.current) { const deleteKeyPressHandler = async (eve: KeyboardEvent) => { if (eve.key === 'Delete' ) { - (window as any)._paq.push(['trackEvent', 'fileExplorer', 'deleteKey']) + feWindow._paq.push(['trackEvent', 'fileExplorer', 'deleteKey', 'deletePath']) setState((prevState) => { return { ...prevState, deleteKey: true } }) @@ -124,7 +125,7 @@ export const FileExplorer = (props: FileExplorerProps) => { } if (eve.metaKey) { if (eve.key === 'Backspace') { - (window as any)._paq.push(['trackEvent', 'fileExplorer', 'osxDeleteKey']) + feWindow._paq.push(['trackEvent', 'fileExplorer', 'osxDeleteKey', 'deletePath']) setState((prevState) => { return { ...prevState, deleteKey: true } }) @@ -164,12 +165,12 @@ export const FileExplorer = (props: FileExplorerProps) => { if (feTarget?.length > 1 && feTarget[0]?.key.length > 1) { await plugin.call('notification', 'alert', { id: 'renameAlert', message: 'You cannot rename multiple files at once!' }) } - await props.editModeOn(feTarget[0].key, feTarget[0].type, false) + props.editModeOn(feTarget[0].key, feTarget[0].type, false) } if (treeRef.current) { const F2KeyPressHandler = async (eve: KeyboardEvent) => { if (eve.key === 'F2' ) { - (window as any)._paq.push(['trackEvent', 'fileExplorer', 'f2ToRename']) + feWindow._paq.push(['trackEvent', 'fileExplorer', 'f2ToRename', 'RenamePath']) await performRename() setState((prevState) => { return { ...prevState, F2Key: true }