Fixed first prefix always selected(hightlighted / cursor "not allowed") (#922)

* The first preset is always selected(highlighted/cursor “not allowed”). In presets file, selected is based on the value of property preset from the default settings object. All preset objects do not have this property but have id instead, since default settings has property preset, all the presets inherit the same property preset, which is why the first preset was always highlighted. Fixed by replacing key name preset to id in default settings.

* removed id key from default settings

* preset is no longer a key in default settings

Co-authored-by: Michael Fix <mrfix84@gmail.com>
main
Caleb Taylor 5 years ago committed by Michael Fix
parent 4239c30730
commit 660f148a19

@ -218,7 +218,7 @@ class Editor extends React.Component {
updateSetting(key, value) {
this.updateState({ [key]: value })
if (Object.prototype.hasOwnProperty.call(DEFAULT_SETTINGS, key) && key !== 'preset') {
if (Object.prototype.hasOwnProperty.call(DEFAULT_SETTINGS, key)) {
this.updateState({ preset: null })
}
}

@ -1052,8 +1052,7 @@ export const DEFAULT_SETTINGS = {
exportSize: '2x',
watermark: false,
squaredImage: false,
hiddenCharacters: false,
preset: 'preset:4'
hiddenCharacters: false
}
export const DEFAULT_PRESETS = [

Loading…
Cancel
Save