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

Keep input when users refresh currency rates #369

Merged
merged 5 commits into from
Apr 16, 2019
Merged

Keep input when users refresh currency rates #369

merged 5 commits into from
Apr 16, 2019

Conversation

rudyhuyn
Copy link
Contributor

Fixes #260

Description of the changes:

  • prevent UnitConverterViewModel to reset values when users click on update rates.
  • recompute UnitConverter's caches (m_ratioMap and m_categoryToUnits) once rates are updated (but check first if the user did/didn't change the category)

How changes were validated:

  • Manually tested with fake currency rates (HTTP responses modified on the fly via FiddlerCore)
  • Verified that it works no matter the selected field (From or To)
  • Verified that the currencies selected are kept after a refresh

@danbelcher-MSFT
Copy link

@rudyhuyn, looks like UTs are failing.

Copy link

@danbelcher-MSFT danbelcher-MSFT left a comment

Choose a reason for hiding this comment

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

Hey Rudy, I think the change looks good. I just have a minor comment about style.

src/CalcManager/UnitConverter.h Outdated Show resolved Hide resolved
Copy link

@danbelcher-MSFT danbelcher-MSFT left a comment

Choose a reason for hiding this comment

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

Thanks, Rudy!

@danbelcher-MSFT danbelcher-MSFT merged commit ad25fed into microsoft:master Apr 16, 2019
EriWong pushed a commit to EriWong/calculator that referenced this pull request Jun 5, 2019
Fixes microsoft#260

Description of the changes:
prevent UnitConverterViewModel to reset values when users click on update rates.
recompute UnitConverter's caches (m_ratioMap and m_categoryToUnits) once rates are updated (but check first if the user did/didn't change the category)

How changes were validated:
Manually tested with fake currency rates (HTTP responses modified on the fly via FiddlerCore)
Verified that it works no matter the selected field (From or To)
Verified that the currencies selected are kept after a refresh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inputs are lost after clicking the "Update rates" button.
3 participants