1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

pool transaction history order tweak

This commit is contained in:
Matthias Kretschmann 2020-10-05 22:25:13 +02:00
parent 01655c883a
commit 6e5754d5d7
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -76,8 +76,14 @@ export default function PoolTransactions(): ReactElement {
if (!ocean || !accountId) return
const logs = await ocean.pool.getAllPoolLogs(accountId)
// limit to 100 latest transactions for now
setLogs(logs.slice(0, 99))
setLogs(
// sort logs by date, newest first
logs.sort((a, b) => {
if (a.timestamp > b.timestamp) return -1
if (a.timestamp < b.timestamp) return 1
return 0
})
)
}
getLogs()
}, [ocean, accountId])