fix: update error msg wen user reject tx + fix refund link render#668
fix: update error msg wen user reject tx + fix refund link render#668Hugo0 merged 1 commit intopeanut-walletfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request modifies the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI as OfframpConfirmView
participant Utils as utils.ErrorHandler
User->>UI: Trigger action causing error
UI->>Utils: Call utils.ErrorHandler(error)
Utils-->>UI: Return structured error message
UI->>User: Display error message
sequenceDiagram
participant User
participant UI as OfframpConfirmView
User->>UI: Initiate refund-related action
UI->>UI: Check if showRefund && createdLink are true
alt Both conditions met
UI->>User: Display refund message with link
else
UI->>User: Do not display refund option
end
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/components/Offramp/Confirm.view.tsx (1)
954-963: Remove redundant nested Link component.The inner Link component is unnecessary since the outer Link already makes the entire content clickable.
Apply this diff to remove the redundant Link:
{showRefund && createdLink && ( <Link href={createdLink ?? ''} className=" text-h8 font-normal "> <Icon name="warning" className="-mt-0.5" /> Something went wrong while trying to cashout. Click{' '} - <Link href={createdLink ?? ''} className="underline"> - here - </Link>{' '} + <span className="underline">here</span>{' '} to reclaim the funds to your wallet. </Link> )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/Offramp/Confirm.view.tsx(2 hunks)
🧰 Additional context used
📓 Learnings (1)
src/components/Offramp/Confirm.view.tsx (1)
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#458
File: src/components/Offramp/Confirm.view.tsx:141-141
Timestamp: 2024-11-12T09:39:20.720Z
Learning: The `handleConfirm` function in `src/components/Create/Link/Confirm.view.tsx` is separate from the one in `src/components/Offramp/Confirm.view.tsx` and does not need to be renamed when refactoring `handleConfirm` in `src/components/Offramp/Confirm.view.tsx`.
🔇 Additional comments (1)
src/components/Offramp/Confirm.view.tsx (1)
467-478: LGTM! Improved error handling using utils.ErrorHandler.The change to use the dedicated utility function
utils.ErrorHandlerprovides more consistent and structured error messages while maintaining the fallback for non-Error instances.
Summary by CodeRabbit