fix(remotecontrol): Execute Reciever.enable only when the value is changed

This commit is contained in:
hristoterezov 2017-01-23 15:01:54 -06:00
parent 4af706bd83
commit 05bfbf5620
1 changed files with 3 additions and 2 deletions

View File

@ -32,9 +32,10 @@ export default class Receiver extends RemoteControlParticipant {
* @param {boolean} enabled the new state.
*/
enable(enabled) {
if(this.enabled !== enabled) {
this.enabled = enabled;
if(this.enabled === enabled) {
return;
}
this.enabled = enabled;
if(enabled === true) {
logger.log("Remote control receiver enabled.");
// Announce remote control support.