order status updates working
This commit is contained in:
@@ -88,14 +88,27 @@ export async function connectWallet() {
|
||||
|
||||
const pendingOrders = []
|
||||
|
||||
|
||||
export function ensureVault() {
|
||||
const s = useStore()
|
||||
if( !s.chain ) {
|
||||
console.log('cannot create vault: no chain selected')
|
||||
return
|
||||
}
|
||||
if( !s.account ) {
|
||||
console.log('cannot create vault: no account logged in')
|
||||
return
|
||||
}
|
||||
socket.emit('ensureVault', s.chainId, s.account, 0)
|
||||
}
|
||||
|
||||
|
||||
export async function pendOrder(order) {
|
||||
console.log('order', JSON.stringify(order))
|
||||
const s = useStore()
|
||||
const signer = await s.provider.getSigner()
|
||||
if (!s.vaults.length) {
|
||||
pendingOrders.push(order)
|
||||
const owner = await signer.getAddress();
|
||||
socket.emit('ensureVault', s.chainId, owner, 0)
|
||||
ensureVault()
|
||||
}
|
||||
else {
|
||||
const vault = s.vaults[0];
|
||||
|
||||
Reference in New Issue
Block a user