ensure default value

pull/2143/head
yann300 3 years ago
parent cd4e934cc7
commit dd71b4c46f
  1. 9
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx

@ -271,7 +271,10 @@ export const EditorUI = (props: EditorUIProps) => {
props.editorAPI.clearDecorationsByPlugin = (filePath: string, plugin: string, typeOfDecoration: string, registeredDecorations: any, currentDecorations: any) => {
const model = editorModelsState[filePath]?.model
if (!model) return
if (!model) return {
currentDecorations: [],
registeredDecorations: []
}
const decorations = []
const newRegisteredDecorations = []
if (registeredDecorations) {
@ -290,7 +293,9 @@ export const EditorUI = (props: EditorUIProps) => {
props.editorAPI.keepDecorationsFor = (filePath: string, plugin: string, typeOfDecoration: string, registeredDecorations: any, currentDecorations: any) => {
const model = editorModelsState[filePath]?.model
if (!model) return
if (!model) return {
currentDecorations: []
}
const decorations = []
if (registeredDecorations) {
for (const decoration of registeredDecorations) {

Loading…
Cancel
Save