feat: adds preferred provider to ramp controller state #7617
+166
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation
The
RampsControllerhas no mechanism to store a user's preferred ramp provider. This PR addspreferredProviderstate to theRampsController.Provider,ProviderLink, andProviderLogostypes inRampsService.tsto match the API provider structurepreferredProvider: Provider | nulltoRampsControllerStatepreferredProvider: nullto default statesetPreferredProvider(provider: Provider | null)method to update the stateselectPreferredProviderselector in the mobile app for Redux accessProvider,ProviderLink, andProviderLogostypes from the package indexThe implementation follows the exact same pattern as
userRegion, ensuring consistency and maintainability.References
https://consensyssoftware.atlassian.net/browse/TRAM-3150
Checklist
Note
Introduces persisted provider preference in the ramps controller state.
preferredProvidertoRampsControllerstate (persisted, included in debug/state logs, exposed to UI) and defaulted tonullsetPreferredProvider(provider: Provider | null)to update the stateProvider,ProviderLink, andProviderLogostypes inRampsServiceand exports them viaindex.tssetPreferredProvider; adjusts selector tests to includepreferredProviderCHANGELOG.mdto document the additionWritten by Cursor Bugbot for commit 4e1e0f7. This will update automatically on new commits. Configure here.