Skip to content

Commit

Permalink
903: OTC order not reset properly (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
piersss authored May 5, 2024
1 parent b8d5e42 commit fe466d5
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/components/@widgets/OrderDetailWidget/OrderDetailWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
selectTakeOtcErrors,
setErrors,
} from "../../../features/takeOtc/takeOtcSlice";
import { compareAddresses } from "../../../helpers/string";
import useAllowance from "../../../hooks/useAllowance";
import useApprovalPending from "../../../hooks/useApprovalPending";
import useDepositPending from "../../../hooks/useDepositPending";
Expand Down Expand Up @@ -146,7 +147,7 @@ const OrderDetailWidget: FC<OrderDetailWidgetProps> = ({ order }) => {
: OrderType.private;
const userIsMakerOfSwap = order.signerWallet === account;
const userIsIntendedRecipient =
order.senderWallet.toLowerCase() === account?.toLowerCase() ||
compareAddresses(order.senderWallet, account || "") ||
order.senderWallet === ADDRESS_ZERO;
const parsedExpiry = useMemo(() => {
return new Date(parseInt(order.expiry) * 1000);
Expand Down Expand Up @@ -270,6 +271,16 @@ const OrderDetailWidget: FC<OrderDetailWidgetProps> = ({ order }) => {
);
}

if (orderTransaction) {
return (
<OrderSubmittedScreen
chainId={chainId}
transaction={orderTransaction}
onMakeNewOrderButtonClick={restart}
/>
);
}

if (state === OrderDetailWidgetState.review && shouldDepositNativeToken) {
return (
<Container>
Expand Down Expand Up @@ -322,16 +333,6 @@ const OrderDetailWidget: FC<OrderDetailWidgetProps> = ({ order }) => {
);
}

if (orderTransaction) {
return (
<OrderSubmittedScreen
chainId={chainId}
transaction={orderTransaction}
onMakeNewOrderButtonClick={restart}
/>
);
}

return (
<Container>
<OrderDetailWidgetHeader
Expand Down

0 comments on commit fe466d5

Please sign in to comment.