From 72b72988477c86f85f423d25a2a0b4cc3f1b65f2 Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Mon, 13 Dec 2021 15:48:08 +0100 Subject: [PATCH] fix new editor --- src/components/NewEditor/Editor.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/NewEditor/Editor.tsx b/src/components/NewEditor/Editor.tsx index cfe878fad..ec4d13968 100644 --- a/src/components/NewEditor/Editor.tsx +++ b/src/components/NewEditor/Editor.tsx @@ -10,12 +10,13 @@ import { MonacoService, EditorsManager, FilesManager, SpecificationService } fro import state from '../../state'; import { TabContext } from '../Panels/Tabs'; +import { sampleSpec } from '../../state/editor'; interface EditorProps extends MonacoEditorProps {} export const Editor: React.FunctionComponent = (props = {}) => { const { currentTab, tab } = useContext(TabContext); - const { file } = tab.metadata || {}; + const { file = {} } = tab.metadata || {}; const editorState = state.useEditorState(); const parserState = state.useParserState(); @@ -70,8 +71,8 @@ export const Editor: React.FunctionComponent = (props = {}) => { return (