Skip to content

fix: update migration modal visibility logic#427

Open
Dprof-in-tech wants to merge 1 commit intomainfrom
fix-migration-banner-showing-for-external-wallet
Open

fix: update migration modal visibility logic#427
Dprof-in-tech wants to merge 1 commit intomainfrom
fix-migration-banner-showing-for-external-wallet

Conversation

@Dprof-in-tech
Copy link
Collaborator

@Dprof-in-tech Dprof-in-tech commented Mar 20, 2026

Description

This pull request updates the logic for displaying the migration modal in the MigrationBannerWrapper component. The new logic ensures that the modal is only shown to users who are not using an injected wallet and have dismissed the modal via store or storage.

  • Migration modal display logic:
    • Updated canShowMigrationModal to only allow showing the modal if the user is not using an injected wallet and has dismissed the modal via store or storage, preventing injected wallet users from seeing the modal. (app/context/MigrationContext.tsx, app/context/MigrationContext.tsxL36-R37)

References

closes #373

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed migration modal display behavior for injected wallets and dismissal states.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a4e383d3-7e35-4bca-b201-b609c392beb9

📥 Commits

Reviewing files that changed from the base of the PR and between f1895a8 and 27dcc8f.

📒 Files selected for processing (1)
  • app/context/MigrationContext.tsx

📝 Walkthrough

Walkthrough

The canShowMigrationModal logic in MigrationContext.tsx was updated to prevent migration modals from displaying for injected/external wallets. The condition now gates modal visibility to non-injected wallets only when not previously dismissed via store or storage.

Changes

Cohort / File(s) Summary
Migration Modal Visibility Logic
app/context/MigrationContext.tsx
Updated canShowMigrationModal condition to prevent showing migration modals (WalletMigrationBanner, MigrationZeroBalanceModal) for injected wallets; now restricts display to native wallets only when not dismissed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • chibie
  • 5ran6
  • onahprosper

Poem

🐰✨ External wallets needn't see that modal glow,
For injected friends already know,
The exportable truth they hold so tight—
Modal banners now respect their right! 🪜

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: update migration modal visibility logic' is clear, concise, and directly summarizes the main change in the changeset.
Description check ✅ Passed The PR description covers the main change, includes issue reference (#373), but the Testing and Checklist sections are incomplete with unchecked boxes and no test coverage details.
Linked Issues check ✅ Passed The code changes directly address issue #373 by preventing the migration modal from showing to injected wallet users, matching the requirement to suppress the modal when injected === true.
Out of Scope Changes check ✅ Passed All changes are scoped to the migration modal visibility logic in MigrationContext.tsx, directly addressing issue #373 with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-migration-banner-showing-for-external-wallet
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modal "Your wallet is now exportable" appearing for External Wallets

1 participant