1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Refactor get initialHeightClassName()

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-12-26 12:42:01 +03:00
parent 46732dec1f
commit 66a287437a

View File

@ -292,13 +292,9 @@ class NonInjectedMonacoEditor extends React.Component<MonacoEditorProps & Depend
validateLazy = debounce(this.validate, 250);
get initialHeightClassName() {
if (!this.props.setInitialHeight) {
return;
}
const lines = this.model.getLineCount();
return styles[this.props.getEditorHeightFromLinesNumber(lines)];
return this.props.setInitialHeight ?
styles[this.props.getEditorHeightFromLinesNumber(this.model.getLineCount())] :
null;
}
render() {