File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/app/src/app/components/CodeEditor/VSCode Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ export const VSCode: React.FunctionComponent = () => {
1717 const { state, actions, effects } = useOvermind ( ) ;
1818 const containerEl = useRef ( null ) ;
1919
20+ const getCurrentModule = React . useCallback (
21+ ( ) => state . editor . currentModule ,
22+ [ ] // eslint-disable-line
23+ ) ;
24+
2025 useEffect ( ( ) => {
2126 const rootEl = containerEl . current ;
2227 const mainContainer = effects . vscode . getEditorElement (
@@ -36,7 +41,7 @@ export const VSCode: React.FunctionComponent = () => {
3641 actions . editor . codeChanged ( { code, moduleShortid } )
3742 }
3843 // Copy the object, we don't want mutations in the component
39- currentModule = { json ( state . editor . currentModule ) }
44+ currentModule = { json ( getCurrentModule ( ) ) }
4045 config = { config }
4146 sandbox = { state . editor . currentSandbox }
4247 { ...( extraProps as any ) }
@@ -60,9 +65,9 @@ export const VSCode: React.FunctionComponent = () => {
6065 } , [
6166 actions . editor ,
6267 effects . vscode ,
63- state . editor . currentModule ,
6468 state . editor . currentSandbox ,
6569 state . editor . currentSandbox . template ,
70+ getCurrentModule ,
6671 ] ) ;
6772
6873 return (
You can’t perform that action at this time.
0 commit comments