forked from AkkomaGang/akkoma-fe
fix v1->v2 transition for localstorage
This commit is contained in:
parent
1059d9b602
commit
652b98b13c
1 changed files with 10 additions and 3 deletions
|
@ -232,9 +232,16 @@ const generateColors = (input) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const generateRadii = (input) => {
|
const generateRadii = (input) => {
|
||||||
const radii = Object.entries(input.radii || {}).filter(([k, v]) => v).reduce((acc, [k, v]) => {
|
let inputRadii = input.radii || {}
|
||||||
const key = k.endsWith('Radius') ? k.split('Radius')[0] : k
|
// v1 -> v2
|
||||||
acc[key] = v
|
if (typeof input.btnRadius !== 'undefined') {
|
||||||
|
inputRadii = Object
|
||||||
|
.entries(input)
|
||||||
|
.filter(([k, v]) => k.endsWith('Radius'))
|
||||||
|
.reduce((acc, e) => { acc[e[0].split('Radius')[0]] = e[1]; return acc }, {})
|
||||||
|
}
|
||||||
|
const radii = Object.entries(inputRadii).filter(([k, v]) => v).reduce((acc, [k, v]) => {
|
||||||
|
acc[k] = v
|
||||||
return acc
|
return acc
|
||||||
}, {
|
}, {
|
||||||
btn: 4,
|
btn: 4,
|
||||||
|
|
Loading…
Reference in a new issue