diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index 0c302e93..33be522b 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -438,15 +438,11 @@ export default { if (!this.keepRoundness) { this.clearRoundness() - // TODO optimize this - this.btnRadiusLocal = radii.btn - this.inputRadiusLocal = radii.input - this.checkboxRadiusLocal = radii.checkbox - this.panelRadiusLocal = radii.panel - this.avatarRadiusLocal = radii.avatar - this.avatarAltRadiusLocal = radii.avatarAlt - this.tooltipRadiusLocal = radii.tooltip - this.attachmentRadiusLocal = radii.attachment + Object.entries(radii).forEach(([k, v]) => { + // 'Radius' is kept mostly for v1->v2 localstorage transition + const key = k.endsWith('Radius') ? k.split('Radius')[0] : k + this[key + 'RadiusLocal'] = v + }) } if (!this.keepShadows) { diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 10583722..2662fc42 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -233,7 +233,8 @@ const generateColors = (input) => { const generateRadii = (input) => { const radii = Object.entries(input.radii || {}).filter(([k, v]) => v).reduce((acc, [k, v]) => { - acc[k] = v + const key = k.endsWith('Radius') ? k.split('Radius')[0] : k + acc[key] = v return acc }, { btn: 4,