Skip to content

Commit 7af5e89

Browse files
committed
INT-3336: Remove redundant if condition
1 parent 859d1f6 commit 7af5e89

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');
@@ -81,12 +82,7 @@ export const render = async (props: Partial<IAllProps> = {}, container: HTMLElem
8182
root.render(<div><Editor apiKey='no-api-key' ref={ctx.ref} {...newProps} /></div>);
8283

8384
if (newProps.disabled) {
84-
if (ctx.editor.editorManager.majorVersion === '4') {
85-
/** This should be `setMode` from TinyMCE v4 but we can't access it here. */
86-
ctx.editor.readonly = true;
87-
} else {
88-
ctx.editor.mode.set('readonly');
89-
}
85+
setMode(ctx.editor, 'readonly');
9086
}
9187

9288
newProps.value

0 commit comments

Comments
 (0)