Skip to content

Commit

Permalink
update: remove then and use only await function
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogomartf committed Aug 9, 2023
1 parent c257f87 commit 5564f1e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/app/components/stack-modal/StackModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface StackModalProps extends ModalBaseProps {

export const txEplorerLink = (tx: string) => `https://gnosisscan.io/tx/${tx}`;

export const transactionExplorerLink = (address: string) =>
export const addressExplorerLink = (address: string) =>
`https://gnosisscan.io/address/${address}#tokentxns`;

interface CancellationTransaction {
Expand Down Expand Up @@ -95,18 +95,18 @@ export const StackModal = ({
setIsCancellationProcessing(true);
const tx = await getDCAOrderContract(stackOrder.id, signer).cancel();
setCancellationTx(tx);
await tx.wait().then(() => {
setIsCancellationProcessing(false);
setIsCancellationSuccess(true);
});

await tx.wait();
setIsCancellationProcessing(false);
setIsCancellationSuccess(true);
} catch (e) {
setIsCancellationProcessing(false);
console.error("error", e);
}
};

return (
<div>
<>
<Modal
maxWidth="2xl"
isOpen={isOpen}
Expand All @@ -128,7 +128,7 @@ export const StackModal = ({
<Link
passHref
target="_blank"
href={transactionExplorerLink(stackOrder.id)}
href={addressExplorerLink(stackOrder.id)}
className="flex items-center space-x-0.5 hover:border-em-low border-b-2 border-em-disabled group"
>
<BodyText className="text-em-med">
Expand Down Expand Up @@ -237,7 +237,7 @@ export const StackModal = ({
primaryText="Back to Stacks"
/>
</Dialog>
</div>
</>
);
};

Expand Down

0 comments on commit 5564f1e

Please sign in to comment.