Skip to content

fix: make us state selection modal dismissible#2858

Merged
HarshMN2345 merged 1 commit intomainfrom
fix-make-us-state-selection-modal-dismissable
Feb 16, 2026
Merged

fix: make us state selection modal dismissible#2858
HarshMN2345 merged 1 commit intomainfrom
fix-make-us-state-selection-modal-dismissable

Conversation

@HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Feb 16, 2026

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

  • Bug Fixes
    • Fixed an issue where users would be repeatedly prompted to provide state information for payment methods they had already dismissed.

@appwrite
Copy link

appwrite bot commented Feb 16, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Global CDN and DDoS protection come free with every Sites deployment

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

Walkthrough

This change adds dismissal tracking for payment methods in a billing component. A new internal state variable dismissedPaymentMethodIds is introduced to maintain a list of payment method IDs that have been dismissed from automatic state update prompts. The selection logic for US-based methods without state information is updated to exclude any method whose ID is in this dismissal list. When a state update flow completes (indicated by showUpdateState becoming false with an active paymentMethodNeedingState), the method's ID is appended to dismissedPaymentMethodIds to prevent the system from re-prompting for state updates on that method.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: make us state selection modal dismissible' clearly summarizes the main change: adding dismissibility to the US state selection modal.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-make-us-state-selection-modal-dismissable

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.

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.

🧹 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 since includes() 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;
     }

@HarshMN2345 HarshMN2345 merged commit da6dfe9 into main Feb 16, 2026
4 checks passed
@HarshMN2345 HarshMN2345 deleted the fix-make-us-state-selection-modal-dismissable branch February 16, 2026 06:01
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.

2 participants