allow highlights in state import/export/presets

main
Mike Fix 4 years ago
parent 421b92b226
commit dd9b43fcae
No known key found for this signature in database
GPG Key ID: 1D85E862314CA79F

@ -257,6 +257,10 @@ const settingButtonStyle = {
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 {
state = {
presets: DEFAULT_PRESETS,
@ -311,8 +315,7 @@ class Settings extends React.PureComponent {
this.props.toggleVisibility()
}
getSettingsFromProps = () =>
omitBy(this.props, (v, k) => !Object.prototype.hasOwnProperty.call(DEFAULT_SETTINGS, k))
getSettingsFromProps = () => omitBy(this.props, invalidSetting)
applyPreset = preset => {
const previousSettings = this.getSettingsFromProps()

Loading…
Cancel
Save