Commit 0cfab431 authored by ioedeveloper's avatar ioedeveloper

Fixed file linking for libraries

parent 9272951f
...@@ -240,7 +240,9 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -240,7 +240,9 @@ export const FileExplorer = (props: FileExplorerProps) => {
if (!createFile) { if (!createFile) {
return toast('Failed to create file ' + newName) return toast('Failed to create file ' + newName)
} else { } else {
await fileManager.open(newName) const path = newName.indexOf(props.name + '/') === 0 ? newName.replace(props.name + '/', '') : newName
await fileManager.open(path)
setState(prevState => { setState(prevState => {
return { ...prevState, focusElement: [{ key: newName, type: 'file' }] } return { ...prevState, focusElement: [{ key: newName, type: 'file' }] }
}) })
...@@ -557,6 +559,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -557,6 +559,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
const handleClickFile = (path: string) => { const handleClickFile = (path: string) => {
path = path.indexOf(props.name + '/') === 0 ? path.replace(props.name + '/', '') : path
state.fileManager.open(path) state.fileManager.open(path)
setState(prevState => { setState(prevState => {
return { ...prevState, focusElement: [{ key: path, type: 'file' }] } return { ...prevState, focusElement: [{ key: path, type: 'file' }] }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment