fix current file

pull/2398/head
Aniket-Engg 3 years ago
parent bda94c960f
commit b9429e2133
  1. 1
      apps/remix-ide/src/app/editor/editor.js
  2. 2
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx

@ -143,6 +143,7 @@ class Editor extends Plugin {
this.on('fileManager', 'fileClosed', (name) => {
if (name === this.currentFile) {
this.currentFile = null
this.renderComponent()
}
})
this.on('theme', 'themeLoaded', (theme) => {

@ -228,7 +228,7 @@ export const EditorUI = (props: EditorUIProps) => {
useEffect(() => {
if (!editorRef.current) return
if (!editorRef.current || !props.currentFile) return
currentFileRef.current = props.currentFile
const file = editorModelsState[props.currentFile]
editorRef.current.setModel(file.model)

Loading…
Cancel
Save