Skip to content

[TASK-14958] fix: reset payment state on component unmount#1288

Merged
Zishan-7 merged 3 commits intopeanut-wallet-devfrom
fix/txn-amount-state-reset
Oct 7, 2025
Merged

[TASK-14958] fix: reset payment state on component unmount#1288
Zishan-7 merged 3 commits intopeanut-wallet-devfrom
fix/txn-amount-state-reset

Conversation

@Zishan-7
Copy link
Contributor

@Zishan-7 Zishan-7 commented Oct 6, 2025

No description provided.

@vercel
Copy link

vercel bot commented Oct 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Ready Ready Preview Comment Oct 7, 2025 10:52am

@notion-workspace
Copy link

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Walkthrough

Replaces the previous cleanup with a useEffect cleanup in src/app/[...recipient]/client.tsx that dispatches resetPaymentState on unmount. The cleanup uses an empty dependency array.

Changes

Cohort / File(s) Summary of changes
Payment cleanup effect
src/app/[...recipient]/client.tsx
Adds a useEffect cleanup that dispatches resetPaymentState on component unmount. The effect uses an empty dependency array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • kushagrasarathe
  • Hugo0

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ❓ Inconclusive Because the author provided no description, there is no contextual detail related to the changeset, making it impossible to evaluate its relevance or content. Please add a brief description summarizing the purpose and scope of the changes to improve clarity and context for reviewers.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly states the fix applied (resetting payment state on component unmount) which matches the changes in the cleanup useEffect and concisely summarizes the main change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/txn-amount-state-reset

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e64fe8 and 986c883.

📒 Files selected for processing (1)
  • src/app/[...recipient]/client.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/[...recipient]/client.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy-Preview

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Oct 6, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a8da32 and 90c16a1.

📒 Files selected for processing (1)
  • src/app/[...recipient]/client.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-18T09:30:42.901Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1230
File: src/app/(mobile-ui)/withdraw/page.tsx:92-97
Timestamp: 2025-09-18T09:30:42.901Z
Learning: In src/app/(mobile-ui)/withdraw/page.tsx, the useEffect that calls setShowAllWithdrawMethods(true) when amountFromContext exists is intentionally designed to run only on component mount (empty dependency array), not when amountFromContext changes. This is the correct behavior for the withdraw flow where showing all methods should only happen on initial load when an amount is already present.

Applied to files:

  • src/app/[...recipient]/client.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy-Preview

Copy link
Contributor

@kushagrasarathe kushagrasarathe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some qn and a nit

@Zishan-7 Zishan-7 merged commit 3ffb529 into peanut-wallet-dev Oct 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants