-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix/double send of on language change and on systeminfo changed #263
Conversation
}.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")) { |
There was a problem hiding this comment.
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:
- Remove
.observes
from function - Find the control bound to this value
- If it is a
Em.Select
you can declarechange
function inside of it and just callonLanguageChangeTTSVR
from that callback
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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
andOnSystemInfoChanged
notifications come twice.Implemented simple mechanism of blocking second notifications sending.
CLA