mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-25 08:11:20 +02:00
refactor: simplify code
This commit is contained in:
parent
c74f9cc6ca
commit
ac773cffda
@ -524,20 +524,17 @@ page_container %}
|
|||||||
blindingFactor: t.B_,
|
blindingFactor: t.B_,
|
||||||
denomination: t.amount
|
denomination: t.amount
|
||||||
}))
|
}))
|
||||||
console.log('### x1', x)
|
.reduce((y, t) => {
|
||||||
x.forEach(t => {
|
|
||||||
y[`_${t.denomination}`] = y[`_${t.denomination}`] || []
|
y[`_${t.denomination}`] = y[`_${t.denomination}`] || []
|
||||||
y[`_${t.denomination}`].push(t)
|
y[`_${t.denomination}`].push(t)
|
||||||
})
|
return y
|
||||||
x = Object.keys(y).map(k => ({
|
}, {})
|
||||||
denomination: y[k][0].denomination,
|
|
||||||
count: y[k].length,
|
|
||||||
value: y[k][0].denomination * y[k].length
|
|
||||||
}))
|
|
||||||
console.log('### x2', x)
|
|
||||||
console.log('### y', y)
|
|
||||||
|
|
||||||
return x
|
return Object.keys(x).map(k => ({
|
||||||
|
denomination: x[k][0].denomination,
|
||||||
|
count: x[k].length,
|
||||||
|
value: x[k][0].denomination * x[k].length
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user