mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 18:51:05 +01:00
refactor: simplify code
This commit is contained in:
parent
c74f9cc6ca
commit
ac773cffda
@ -524,20 +524,17 @@ page_container %}
|
||||
blindingFactor: t.B_,
|
||||
denomination: t.amount
|
||||
}))
|
||||
console.log('### x1', x)
|
||||
x.forEach(t => {
|
||||
y[`_${t.denomination}`] = y[`_${t.denomination}`] || []
|
||||
y[`_${t.denomination}`].push(t)
|
||||
})
|
||||
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)
|
||||
.reduce((y, t) => {
|
||||
y[`_${t.denomination}`] = y[`_${t.denomination}`] || []
|
||||
y[`_${t.denomination}`].push(t)
|
||||
return 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: {
|
||||
|
Loading…
Reference in New Issue
Block a user