Fixed fileExplorer bugs

pull/668/head
ioedeveloper 4 years ago
parent 0719089782
commit 861fcfa028
  1. 4
      apps/remix-ide/src/app/files/fileProvider.js
  2. 2
      libs/remix-lib/src/eventManager.ts
  3. 2
      libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx

@ -63,10 +63,10 @@ class FileProvider {
}) })
} }
exists (path) { exists (path, cb) {
// todo check the type (directory/file) as well #2386 // todo check the type (directory/file) as well #2386
// currently it is not possible to have a file and folder with same path // currently it is not possible to have a file and folder with same path
return this._exists(path) return cb(null, this._exists(path))
} }
_exists (path) { _exists (path) {

@ -26,7 +26,7 @@ export class EventManager {
obj = this.anonymous obj = this.anonymous
} }
for (const reg in this.registered[eventName]) { for (const reg in this.registered[eventName]) {
if ((this.registered[eventName][reg].obj.toString() === obj.toString()) && (this.registered[eventName][reg].func.toString() === func.toString())) { if ((this.registered[eventName][reg].obj === obj) && (this.registered[eventName][reg].func.toString() === func.toString())) {
this.registered[eventName].splice(reg, 1) this.registered[eventName].splice(reg, 1)
} }
} }

@ -4,7 +4,7 @@ import { FileExplorerContextMenuProps } from './types'
import './css/file-explorer-context-menu.css' import './css/file-explorer-context-menu.css'
export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => { export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) => {
const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, extractParentFromKey, publishToGist, runScript, pageX, pageY, path, type, ...otherProps } = props const { actions, createNewFile, createNewFolder, deletePath, renamePath, hideContextMenu, publishToGist, runScript, pageX, pageY, path, type, ...otherProps } = props
const contextMenuRef = useRef(null) const contextMenuRef = useRef(null)
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save