-
Notifications
You must be signed in to change notification settings - Fork 210
feat: require state for existing US payment methods #2804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Console (appwrite/console)Project ID: Tip Sites support three domain rule types: Active deployment, Git branch, and Redirect |
WalkthroughAdds a new Svelte component Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/lib/components/billing/updateStateModal.svelte`:
- Around line 22-24: selectedState currently persists between modal opens
causing stale selections; update the component to reset selectedState when the
modal closes (or reinitialize it from paymentMethod when the modal opens).
Specifically, add logic that listens for the modal close/open state (e.g., an
on:close handler or a reactive watcher on the modal `open` prop) and set
selectedState = '' (or selectedState = paymentMethod?.state) and clear
isSubmitting/error as appropriate; reference the existing selectedState,
isSubmitting, error and paymentMethod symbols when adding the reset logic so the
selection is cleared on close or correctly initialized on open.
🧹 Nitpick comments (2)
src/lib/components/billing/updateStateModal.svelte (2)
1-1: Rename component file to PascalCase.
updateStateModal.svelteshould beUpdateStateModal.svelteundersrc/lib/components/billing/to match the component naming guideline; update imports accordingly. As per coding guidelines.
10-12: Use $lib alias for local imports.Avoid relative imports from
src/lib; use$libaliases for both the state list and component index. As per coding guidelines.♻️ Suggested import cleanup
- import { states } from './state'; - import { CreditCardBrandImage } from '../index.js'; + import { states } from '$lib/components/billing/state'; + import { CreditCardBrandImage } from '$lib/components';
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

What does this PR do?
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.