Skip to content
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

Maintain activeCurrency in CurrencyRateController state #22

Closed
wants to merge 1 commit into from

Conversation

estebanmino
Copy link
Contributor

This PR allows to maintain activeCurrency in CurrencyRateController in order to persist information in currentCurrency state when the controller is disabled and enabled again.

Copy link
Contributor

@bitpshr bitpshr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment then this looks good.

@@ -85,31 +84,31 @@ export class CurrencyRateController extends BaseController<CurrencyRateConfig, C
* @param currency - ISO 4217 currency code
*/
set currency(currency: string) {
this.activeCurrency = currency;
this.update({ currentCurrency: currency });
Copy link
Contributor

@bitpshr bitpshr Nov 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since currency is now maintained as state, it doesn't need a getter at all. This whole method can go away now (and the associated tests.) Instead, downstream modules would pass in a new (or initial) currency by setting state.

@bitpshr
Copy link
Contributor

bitpshr commented Nov 27, 2018

Closing in favor of #30, which includes more related cleanup.

@bitpshr bitpshr closed this Nov 27, 2018
@estebanmino estebanmino deleted the currecy-controller-state branch November 30, 2018 01:23
rickycodes added a commit that referenced this pull request Nov 23, 2022
* 32.0.4

* update changelog

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ricky Miller <ricky.miller@gmail.com>
rickycodes added a commit that referenced this pull request Nov 23, 2022
* 'main' of github.com:rickycodes/controllers:
  32.0.4 (#22)
mcmire pushed a commit to mcmire/core that referenced this pull request Jul 17, 2023
* 3.0.0

* Update changelog

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
MajorLift pushed a commit that referenced this pull request Sep 22, 2023
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