Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private setEditorOptions = ( editor: AceEditor ) => {
const userJson = this.props.user ? getUserJson( this.props.user ) : {}
const userSettings: CodeEditorInput.Settings = userJson ? userJson.codeEditorSettings || {} : {}
const displaySettings = this.props.displaySettings || {}
editor.setTheme( displaySettings.theme || userSettings.theme || 'ace/theme/tomorrow_night_eighties' )
editor.setFontSize( displaySettings.fontSize || userSettings.fontSize || '12px' )
let showInvisibles = false
if ( displaySettings.showInvisibles !== undefined ) {
showInvisibles = displaySettings.showInvisibles
}
else if ( userSettings.showInvisibles !== undefined ) {
showInvisibles = userSettings.showInvisibles