|
|
@ -257,6 +257,10 @@ const settingButtonStyle = {
|
|
|
|
height: '100%',
|
|
|
|
height: '100%',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const invalidSetting = (v, k) =>
|
|
|
|
|
|
|
|
// Allow highlights in presets and config exports
|
|
|
|
|
|
|
|
!(Object.prototype.hasOwnProperty.call(DEFAULT_SETTINGS, k) || k === 'highlights')
|
|
|
|
|
|
|
|
|
|
|
|
class Settings extends React.PureComponent {
|
|
|
|
class Settings extends React.PureComponent {
|
|
|
|
state = {
|
|
|
|
state = {
|
|
|
|
presets: DEFAULT_PRESETS,
|
|
|
|
presets: DEFAULT_PRESETS,
|
|
|
@ -311,8 +315,7 @@ class Settings extends React.PureComponent {
|
|
|
|
this.props.toggleVisibility()
|
|
|
|
this.props.toggleVisibility()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getSettingsFromProps = () =>
|
|
|
|
getSettingsFromProps = () => omitBy(this.props, invalidSetting)
|
|
|
|
omitBy(this.props, (v, k) => !Object.prototype.hasOwnProperty.call(DEFAULT_SETTINGS, k))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
applyPreset = preset => {
|
|
|
|
applyPreset = preset => {
|
|
|
|
const previousSettings = this.getSettingsFromProps()
|
|
|
|
const previousSettings = this.getSettingsFromProps()
|
|
|
|