Skip to content

Keep input when users refresh currency rates#369

Merged
danbelcher-MSFT merged 5 commits intomicrosoft:masterfrom
rudyhuyn:Fix260
Apr 16, 2019
Merged

Keep input when users refresh currency rates#369
danbelcher-MSFT merged 5 commits intomicrosoft:masterfrom
rudyhuyn:Fix260

Conversation

@rudyhuyn
Copy link
Copy Markdown
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
Copy Markdown

@rudyhuyn, looks like UTs are failing.

Copy link
Copy Markdown

@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.

Copy link
Copy Markdown

@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