Skip to content

Commit

Permalink
throw error if no project id
Browse files Browse the repository at this point in the history
  • Loading branch information
alissacrane-cb committed Dec 16, 2024
1 parent 40e8074 commit 24c5d01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/buy/components/BuyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ export function BuyProvider({
const { sendTransactionAsync } = useSendTransaction(); // Sending the transaction (and approval, if applicable)
const { sendCallsAsync } = useSendCalls(); // Atomic Batch transactions (and approval, if applicable)

// Validate `projectId` prop
if (!projectId) {
throw new Error(
'Buy: projectId must be provided as a prop to the Buy component.',
);
}

// Refreshes balances and inputs post-swap
const resetInputs = useResetBuyInputs({ fromETH, fromUSDC, from, to });
// For batched transactions, listens to and awaits calls from the Wallet server
Expand Down

0 comments on commit 24c5d01

Please sign in to comment.