re-establish subscriptions after ws disconnect
This commit is contained in:
@@ -4,12 +4,17 @@ import {flushOrders} from "@/blockchain/wallet.js";
|
||||
import {parseElaboratedOrderStatus} from "@/blockchain/orderlib.js";
|
||||
import { DataFeed } from "./charts/datafeed";
|
||||
import {notifyFillEvent} from "@/notify.js";
|
||||
import {refreshOHLCSubs} from "@/blockchain/ohlcs.js";
|
||||
|
||||
export const socket = io(import.meta.env.VITE_WS_URL || undefined, {transports: ["websocket"]})
|
||||
|
||||
socket.on('connect', () => {
|
||||
console.log(new Date(), 'ws connected')
|
||||
useStore().connected = true
|
||||
const s = useStore();
|
||||
s.connected = true
|
||||
if (s.chainId && s.account)
|
||||
socket.emit('address', s.chainId, s.account)
|
||||
refreshOHLCSubs()
|
||||
})
|
||||
|
||||
socket.on('disconnect', () => {
|
||||
|
||||
Reference in New Issue
Block a user