From c0aad693e0bd90e4d22da76064109feb776850cc Mon Sep 17 00:00:00 2001 From: 7400 <7400> Date: Sun, 17 Mar 2024 22:44:35 -0700 Subject: [PATCH] subOHLCs should emit object, not string. --- pool.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pool.js b/pool.js index f670996..8febb83 100644 --- a/pool.js +++ b/pool.js @@ -23,8 +23,11 @@ export async function subOHLCs( socket, chainId, poolPeriods) { for(const key of poolPeriods) { const room = `${chainId}|${key}`; socket.join(room) - const ohlc = await ohlcs.get(chainId,key); + let ohlc = await ohlcs.get(chainId,key); console.log('got ohlc', ohlc) + if (typeof(ohlc)==='string') { + ohlc = JSON.parse(ohlc) + } socket.emit('ohlc', chainId, key, ohlc) console.log('joined room', room) }