|
|
@ -7,7 +7,7 @@ import { FileExplorerMenu } from './file-explorer-menu' // eslint-disable-line |
|
|
|
import { FileExplorerContextMenu } from './file-explorer-context-menu' // eslint-disable-line
|
|
|
|
import { FileExplorerContextMenu } from './file-explorer-context-menu' // eslint-disable-line
|
|
|
|
import { FileExplorerProps, File, MenuItems, FileExplorerState } from './types' |
|
|
|
import { FileExplorerProps, File, MenuItems, FileExplorerState } from './types' |
|
|
|
import { fileSystemReducer, fileSystemInitialState } from './reducers/fileSystem' |
|
|
|
import { fileSystemReducer, fileSystemInitialState } from './reducers/fileSystem' |
|
|
|
import { init, resolveDirectory, addInputField, removeInputField } from './actions/fileSystem' |
|
|
|
import { addInputField, removeInputField } from './actions/fileSystem' |
|
|
|
import * as helper from '../../../../../apps/remix-ide/src/lib/helper' |
|
|
|
import * as helper from '../../../../../apps/remix-ide/src/lib/helper' |
|
|
|
import QueryParams from '../../../../../apps/remix-ide/src/lib/query-params' |
|
|
|
import QueryParams from '../../../../../apps/remix-ide/src/lib/query-params' |
|
|
|
import { FileSystemContext } from '@remix-ui/workspace' |
|
|
|
import { FileSystemContext } from '@remix-ui/workspace' |
|
|
@ -53,16 +53,6 @@ export const FileExplorer = (props: FileExplorerProps) => { |
|
|
|
const editRef = useRef(null) |
|
|
|
const editRef = useRef(null) |
|
|
|
const global = useContext(FileSystemContext) |
|
|
|
const global = useContext(FileSystemContext) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
init(props.filesProvider, props.plugin, props.registry)(dispatch) |
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
if (fileSystem.notification.message) { |
|
|
|
|
|
|
|
global.modal(fileSystem.notification.title, fileSystem.notification.message, fileSystem.notification.labelOk, fileSystem.notification.actionOk, fileSystem.notification.labelCancel, fileSystem.notification.actionCancel) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, [fileSystem.notification.message]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if (global.fs.mode === 'browser') { |
|
|
|
if (global.fs.mode === 'browser') { |
|
|
|
setState(prevState => { |
|
|
|
setState(prevState => { |
|
|
@ -550,7 +540,7 @@ export const FileExplorer = (props: FileExplorerProps) => { |
|
|
|
|
|
|
|
|
|
|
|
if (!state.expandPath.includes(path)) { |
|
|
|
if (!state.expandPath.includes(path)) { |
|
|
|
expandPath = [...new Set([...state.expandPath, path])] |
|
|
|
expandPath = [...new Set([...state.expandPath, path])] |
|
|
|
resolveDirectory(fileSystem.provider.provider, path)(dispatch) |
|
|
|
global.dispatchFetchDirectory(path) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
expandPath = [...new Set(state.expandPath.filter(key => key && (typeof key === 'string') && !key.startsWith(path)))] |
|
|
|
expandPath = [...new Set(state.expandPath.filter(key => key && (typeof key === 'string') && !key.startsWith(path)))] |
|
|
|
} |
|
|
|
} |
|
|
|