Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joeizang committed Jul 15, 2024
1 parent 1838d1f commit 198a93d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string[]>([])
const feWindow = (window as any)

useEffect(() => {
if (contextMenuItems) {
Expand Down Expand Up @@ -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 }
})
Expand All @@ -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 }
})
Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 198a93d

Please sign in to comment.