Skip to content

Commit

Permalink
fixup! feat(trading): trading sign message flow
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeWall committed Feb 16, 2025
1 parent 507cf27 commit ce372cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -638,18 +638,22 @@ export const useTradingExchangeForm = ({
return;
}

const quote = { ...selectedQuote };
quote.signature = signature;
quote.status = 'SIGN_DATA';
const trade = { ...selectedQuote };
trade.signature = signature;
trade.status = 'SIGN_DATA';

if (!trade.receiveAddress) {
return;
}

dispatch(
tradingExchangeActions.saveTrade(
quote,
trade,
selectedAccount.account,
new Date().toISOString(),
),
);
confirmTrade(quote.receiveAddress || '', undefined, quote);
confirmTrade(trade.receiveAddress, undefined, trade);
};

const goToOffers = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,7 @@ export const TradingOfferExchangeSendApproval = () => {

if (selectedQuote.approvalType) {
updatedSelectedQuote.approvalType = undefined;
dispatch(
saveSelectedQuote({
...selectedQuote,
approvalType: undefined,
}),
);
dispatch(saveSelectedQuote(updatedSelectedQuote));
}

await confirmTrade(dexTx.from, undefined, updatedSelectedQuote);
Expand Down

0 comments on commit ce372cb

Please sign in to comment.