fix: #657 guarantee that order.id is present at this point or we need to determine the id of the order

This commit is contained in:
madalinaraicu
2022-07-08 15:56:02 +03:00
parent e8765329d2
commit ae4b0482c2
@@ -1,4 +1,5 @@
import { useCallback, useEffect, useState } from 'react';
import { determineId } from '@vegaprotocol/react-helpers';
import { useVegaWallet, useVegaTransaction } from '@vegaprotocol/wallet';
import { useApolloClient } from '@apollo/client';
import type {
@@ -69,7 +70,11 @@ export const useOrderCancel = () => {
});
if (res?.signature) {
setId(order.id);
if (order.id) {
setId(order.id);
} else {
setId(determineId(res.signature));
}
}
return res;
} catch (e) {