fix: diffEditor组件在某些场景下使用变量时导致页面卡死的问题

This commit is contained in:
wutong25 2023-09-06 14:45:06 +08:00
parent 774ad6f3c7
commit 83ec19b060

View File

@ -199,7 +199,14 @@ export class DiffEditor extends React.Component<DiffEditorProps, any> {
value !== prevProps.value &&
!this.state.focused
) {
this.modifiedEditor.getModel().setValue(normalizeValue(value, language));
this.modifiedEditor.getModel().setValue(
isPureVariable(value as string)
? normalizeValue(
resolveVariableAndFilter(value || '', data, '| raw', () => ''),
language
)
: normalizeValue(value, language)
);
}
}