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%', 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()

Loading…
Cancel
Save