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

Fix/double send of on language change and on systeminfo changed #263

Conversation

YarikMamykin
Copy link
Contributor

Fixes #256

This PR is ready for review.

Testing Plan

Manual testing by steps described in #256

Summary

There is known bug in old version of Ember.js (specifically 1.0, which is currently used) - observers of SelectView item are noticed twice per each event. That is why OnLanguageChanged and OnSystemInfoChanged notifications come twice.
Implemented simple mechanism of blocking second notifications sending.

CLA

}.observes('SDL.SDLModel.data.hmiUILanguage'),
/**
* Method to set language for TTS and VR components with parameters sent
* from SDLCore to UIRPC
*/
onLanguageChangeTTSVR: function() {
if (!this.canNotifyOnLanguageChange("VR")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@YarikMamykin it can be done in a simpler way:

  1. Remove .observes from function
  2. Find the control bound to this value
  3. If it is a Em.Select you can declare change function inside of it and just call onLanguageChangeTTSVR from that callback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AKalinich-Luxoft , unfortunately it doesn't work. In such case selected value will be changed with latency.
For example if you choose FR-CA language and current language is EN-US, then notification will send updated language value = EN-US! After that you can choose another language and only then FR-CA language will be displayed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@YarikMamykin use this.selection in change and pass it as a parameter to onLanguageChangeTTSVR then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AKalinich-Luxoft , yes, this idea works well! Thanks for the tip!
Take a look at 51d3013

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.

5 participants