Browse Source

Fix ops sort of Ethereum & Ripple

master
Gaëtan Renaudeau 7 years ago
parent
commit
e13c88c4bc
  1. 2
      src/bridge/EthereumJSBridge.js
  2. 2
      src/bridge/RippleJSBridge.js

2
src/bridge/EthereumJSBridge.js

@ -87,7 +87,7 @@ function isRecipientValid(currency, recipient) {
function mergeOps(existing: Operation[], newFetched: Operation[]) {
const ids = newFetched.map(o => o.id)
const all = newFetched.concat(existing.filter(o => !ids.includes(o.id)))
return uniqBy(all.sort((a, b) => a.date - b.date), 'id')
return uniqBy(all.sort((a, b) => b.date - a.date), 'id')
}
const fetchCurrentBlock = (perCurrencyId => currency => {

2
src/bridge/RippleJSBridge.js

@ -55,7 +55,7 @@ function isRecipientValid(currency, recipient) {
function mergeOps(existing: Operation[], newFetched: Operation[]) {
const ids = existing.map(o => o.id)
const all = existing.concat(newFetched.filter(o => !ids.includes(o.id)))
return all.sort((a, b) => a.date - b.date)
return all.sort((a, b) => b.date - a.date)
}
type Tx = {

Loading…
Cancel
Save