Skip to content

Commit

Permalink
Merge pull request #13646 from sg00dwin/release-4.14-backports
Browse files Browse the repository at this point in the history
OCPBUGS-29813: Release 4.14 backports
  • Loading branch information
openshift-merge-bot[bot] committed Mar 6, 2024
2 parents 773c6d9 + fb02148 commit dca881c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -187,7 +187,7 @@ export const enableYAMLValidation = (
) => {
const pendingValidationRequests = new Map();

const getModel = () => monaco.editor.getModels()[0];
const getModel = () => monaco.editor?.getModels()[0];

const cleanPendingValidation = (document) => {
const request = pendingValidationRequests.get(document.uri);
Expand Down Expand Up @@ -226,7 +226,7 @@ export const enableYAMLValidation = (
tryFolding();
}

getModel().onDidChangeContent(() => {
getModel()?.onDidChangeContent(() => {
tryFolding();

const document = createDocument(getModel());
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/components/edit-yaml.jsx
Expand Up @@ -199,7 +199,7 @@ const EditYAMLInner = (props) => {
const notAll = !resp.status.allowed;
setNotAllowed(notAll);
if (monacoRef.current) {
monacoRef.current.editor.updateOptions({ readOnly: notAll });
monacoRef.current.editor?.updateOptions({ readOnly: notAll });
}
})
.catch((e) => {
Expand Down Expand Up @@ -638,7 +638,7 @@ const EditYAMLInner = (props) => {
'co-file-dropzone--drop-over': isOver,
});

monacoRef.current?.editor.updateOptions({ hover: showTooltips });
monacoRef.current?.editor?.updateOptions({ hover: showTooltips });

if (displayResults) {
return (
Expand Down

0 comments on commit dca881c

Please sign in to comment.