Fixes status change from pending to unavailable.

This commit is contained in:
yanas 2016-03-29 13:46:10 -05:00
parent 7df5e92bc9
commit 51037c2dca
1 changed files with 14 additions and 2 deletions

View File

@ -209,6 +209,10 @@ var Recording = {
}, },
updateRecordingState(recordingState) { updateRecordingState(recordingState) {
// If there's no state change, we ignore the update.
if (this.currentState === recordingState)
return;
this.setRecordingButtonState(recordingState); this.setRecordingButtonState(recordingState);
}, },
@ -227,7 +231,14 @@ var Recording = {
moveToCorner(labelSelector, true, 3000); moveToCorner(labelSelector, true, 3000);
labelSelector labelSelector
.text(APP.translation.translateString(this.recordingOnKey)); .text(APP.translation.translateString(this.recordingOnKey));
} else if (recordingState === 'off') { } else if (recordingState === 'off'
|| recordingState === 'unavailable') {
// We don't want to do any changes if this is
// an availability change.
if (this.currentState === "available"
|| this.currentState === "unavailable")
return;
buttonSelector.removeClass(this.baseClass + " active"); buttonSelector.removeClass(this.baseClass + " active");
buttonSelector.addClass(this.baseClass); buttonSelector.addClass(this.baseClass);
@ -245,7 +256,8 @@ var Recording = {
setTimeout(function(){ setTimeout(function(){
$('#recordingLabel').css({display: "none"}); $('#recordingLabel').css({display: "none"});
}, 5000); }, 5000);
} else if (recordingState === 'pending') { }
else if (recordingState === 'pending') {
buttonSelector.removeClass(this.baseClass + " active"); buttonSelector.removeClass(this.baseClass + " active");
buttonSelector.addClass(this.baseClass); buttonSelector.addClass(this.baseClass);