Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes aimed at improving error handling, refining URL parameter parsing, and enhancing transaction processing. The most important changes include adding error handling for transaction failures, updating URL parameter parsing logic, and refining the transaction processing methods.
Error Handling Improvements:
src/components/wallet-selector/WalletSelector.ts
: Added error handling tosignAndSendTransactions
andsignAndSendTransaction
methods to throw errors if transactions fail.src/utils/algoliaSearchApi.ts
: Enhanced error message infetchSearchHits
to include a suggestion to try again.src/utils/catalogSearchApi.ts
: Wrapped thefetchCatalog
function in a try-catch block to handle errors gracefully and return an empty array if an error occurs.URL Parameter Parsing:
src/pages/[accountId]/widget/[componentName].tsx
: Updated theuseEffect
hook to useURLSearchParams
for parsing URL parameters instead of directly usingrouter.query
. (src/pages/[accountId]/widget/[componentName].tsxL31-R33)src/pages/embed/[accountId]/widget/[componentName].tsx
: Similar update to useURLSearchParams
for parsing URL parameters. (src/pages/embed/[accountId]/widget/[componentName].tsxL22-R24)Minor Adjustments:
src/pages/index.tsx
: Adjusted the average transaction price format and added a check to ensure data exists before processing it. [1] [2] [3]src/pages/[accountId]/widget/[componentName].tsx
: Corrected the parameter passed toshouldPassGatewayEventProps
fromrouter.query.componentAccountId
torouter.query.accountId
. (src/pages/[accountId]/widget/[componentName].tsxL40-R42)