tv DataFeed rework
This commit is contained in:
@@ -15,7 +15,7 @@ socket.on('disconnect', () => {
|
||||
})
|
||||
|
||||
socket.on('p', async (chainId, pool, price) => {
|
||||
// console.log('pool price from message', chainId, pool, price)
|
||||
console.log('pool price from message', chainId, pool, price)
|
||||
const s = useStore()
|
||||
if( s.chainId !== chainId )
|
||||
return
|
||||
@@ -27,7 +27,7 @@ socket.on('ohlc', async (chainId, poolPeriod, ohlcs) => {
|
||||
if (ohlcs && ohlcs.length) {
|
||||
const split = poolPeriod.indexOf('|')
|
||||
const pool = poolPeriod.slice(0,split)
|
||||
useStore().poolPrices[[chainId, pool]] = ohlcs[ohlcs.length - 1][4] // closing price
|
||||
useStore().poolPrices[[chainId, pool]] = parseFloat(ohlcs[ohlcs.length - 1][4]) // closing price
|
||||
}
|
||||
DataFeed.poolCallback(chainId, poolPeriod, ohlcs)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user