Fixed new input bug

pull/668/head
ioedeveloper 4 years ago
parent c70a463a37
commit 012537c312
  1. 7
      libs/remix-ui/file-explorer/src/lib/file-explorer.tsx

@ -103,8 +103,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
const { expandPath } = state const { expandPath } = state
if (expandPath && expandPath.length > 0) { if (expandPath && expandPath.length > 0) {
expandPath.map(async (path, index) => { expandPath.map(async (path) => {
console.log('path ' + index + ' :', path)
const files = await resolveDirectory(path, state.files) const files = await resolveDirectory(path, state.files)
setState(prevState => { setState(prevState => {
@ -123,7 +122,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
dir = await Promise.all(dir.map(async (file) => { dir = await Promise.all(dir.map(async (file) => {
if (file.path === folderPath) { if (file.path === folderPath) {
if (file.child) { if (file.child) {
const newInput = file.child.filter(({ path }) => path === 'browser/blank') const newInput = file.child.filter(({ path }) => path.endsWith('/blank'))
if (newInput.length === 1) { if (newInput.length === 1) {
const dirContent = await fetchDirectoryContent(folderPath) const dirContent = await fetchDirectoryContent(folderPath)
@ -880,7 +879,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
label={label(file)} label={label(file)}
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
handleClickFolder(file.path) if (state.focusEdit.element !== file.path) handleClickFolder(file.path)
}} }}
onContextMenu={(e) => { onContextMenu={(e) => {
e.preventDefault() e.preventDefault()

Loading…
Cancel
Save