order pending bugfix

This commit is contained in:
Tim Olson
2023-11-02 00:38:39 -04:00
parent a4c664eb90
commit f3aef443b3
2 changed files with 32 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
import {io} from "socket.io-client";
import {useStore} from "@/store/store.js";
import {onChainChanged} from "@/blockchain/wallet.js";
import {flushOrders, onChainChanged} from "@/blockchain/wallet.js";
import {ethers} from "ethers";
export const socket = io(import.meta.env.VITE_WS_URL || undefined, {transports: ["websocket"]})
@@ -39,3 +39,13 @@ socket.on('vb', async (vault, balances) => {
s.$patch({vaultBalances:vb})
console.log('vault balances', vault, vb)
})
socket.on('vaults', (vaults)=>{
const s = useStore()
console.log('vaults', vaults)
s.vaults = vaults
if( vaults.length ) {
const vault = vaults[0]
flushOrders(vault)
}
})