fix: make us state selection modal dismissible#2858
Conversation
Console (appwrite/console)Project ID: Tip Global CDN and DDoS protection come free with every Sites deployment |
WalkthroughThis change adds dismissal tracking for payment methods in a billing component. A new internal state variable Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
src/routes/(console)/organization-[organization]/billing/paymentMethods.svelte (1)
132-140: Consider guarding against duplicate entries.If this effect re-fires for the same
paymentMethodNeedingState(e.g., due to unrelated reactive re-evaluations), the same ID will be appended again. It's functionally harmless sinceincludes()still works, but a small guard keeps the array clean.Optional: deduplicate before appending
if (!showUpdateState && paymentMethodNeedingState) { - dismissedPaymentMethodIds = [ - ...dismissedPaymentMethodIds, - paymentMethodNeedingState.$id - ]; + if (!dismissedPaymentMethodIds.includes(paymentMethodNeedingState.$id)) { + dismissedPaymentMethodIds = [ + ...dismissedPaymentMethodIds, + paymentMethodNeedingState.$id + ]; + } paymentMethodNeedingState = null; }

What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
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