fix F2 rename bug

pull/5370/head
Joseph Izang 5 months ago
parent e3eaf9dfd8
commit 5ae3b0abbf
  1. 4
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx

@ -158,10 +158,10 @@ export const FileExplorer = (props: FileExplorerProps) => {
useEffect(() => { useEffect(() => {
const performRename = async () => { const performRename = async () => {
if (feTarget?.length > 0 && feTarget[0]?.key.length > 0) { 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 plugin.call('notification', 'alert', { id: 'renameAlert', message: 'You cannot rename multiple files at once!' })
} }
await props.dispatchRenamePath(feTarget[0].key, feTarget[0].type) await props.editModeOn(feTarget[0].key, feTarget[0].type, false)
} }
if (treeRef.current) { if (treeRef.current) {
const F2KeyPressHandler = async (eve: KeyboardEvent) => { const F2KeyPressHandler = async (eve: KeyboardEvent) => {

Loading…
Cancel
Save