From fcd5cee30b3008dfa9ad6d1b4343d2ba09e4ca48 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Tue, 19 May 2020 20:34:11 -0700 Subject: [PATCH] sanitize export config values --- components/Settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Settings.js b/components/Settings.js index fc1338b..5b5be51 100644 --- a/components/Settings.js +++ b/components/Settings.js @@ -11,7 +11,7 @@ import Popout, { managePopout } from './Popout' import Button from './Button' import Presets from './Presets' import MenuButton from './MenuButton' -import { COLORS, DEFAULT_PRESETS } from '../lib/constants' +import { COLORS, DEFAULT_PRESETS, DEFAULT_SETTINGS } from '../lib/constants' import { toggle, getPresets, savePresets, generateId, fileToJSON } from '../lib/util' import SettingsIcon from './svg/Settings' @@ -287,7 +287,7 @@ class Settings extends React.PureComponent { } getSettingsFromProps = () => - omitBy(this.props, (v, k) => typeof v === 'function' || k === 'preset') + omitBy(this.props, (v, k) => !Object.prototype.hasOwnProperty.call(DEFAULT_SETTINGS, k)) applyPreset = preset => { const previousSettings = this.getSettingsFromProps()