Skip to content

Commit b556b43

Browse files
committed
INT-3336: Remove redundant if condition
1 parent e446271 commit b556b43

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/test/ts/alien/Loader.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Editor, IAllProps, IProps, Version } from '../../../main/ts/components/
66
import { Editor as TinyMCEEditor } from 'tinymce';
77
import { before, context } from '@ephox/bedrock-client';
88
import { VersionLoader } from '@tinymce/miniature';
9+
import { setMode } from 'src/main/ts/Utils';
910

1011
// @ts-expect-error Remove when dispose polyfill is not needed
1112
Symbol.dispose ??= Symbol('Symbol.dispose');
@@ -84,12 +85,7 @@ export const render = async (props: Partial<IAllProps> = {}, container: HTMLElem
8485
root.render(<div><Editor apiKey='no-api-key' ref={ctx.ref} {...newProps} /></div>);
8586

8687
if (newProps.disabled) {
87-
if (ctx.editor.editorManager.majorVersion === '4') {
88-
/** This should be `setMode` from TinyMCE v4 but we can't access it here. */
89-
ctx.editor.readonly = true;
90-
} else {
91-
ctx.editor.mode.set('readonly');
92-
}
88+
setMode(ctx.editor, 'readonly');
9389
}
9490

9591
newProps.value

0 commit comments

Comments
 (0)