Pārlūkot izejas kodu

Fixes status change from pending to unavailable.

j8
yanas 9 gadus atpakaļ
vecāks
revīzija
51037c2dca
1 mainītis faili ar 14 papildinājumiem un 2 dzēšanām
  1. 14
    2
      modules/UI/recording/Recording.js

+ 14
- 2
modules/UI/recording/Recording.js Parādīt failu

209
     },
209
     },
210
 
210
 
211
     updateRecordingState(recordingState) {
211
     updateRecordingState(recordingState) {
212
+        // If there's no state change, we ignore the update.
213
+        if (this.currentState === recordingState)
214
+            return;
215
+
212
         this.setRecordingButtonState(recordingState);
216
         this.setRecordingButtonState(recordingState);
213
     },
217
     },
214
 
218
 
227
             moveToCorner(labelSelector, true, 3000);
231
             moveToCorner(labelSelector, true, 3000);
228
             labelSelector
232
             labelSelector
229
                 .text(APP.translation.translateString(this.recordingOnKey));
233
                 .text(APP.translation.translateString(this.recordingOnKey));
230
-        } else if (recordingState === 'off') {
234
+        } else if (recordingState === 'off'
235
+                    || recordingState === 'unavailable') {
236
+
237
+            // We don't want to do any changes if this is
238
+            // an availability change.
239
+            if (this.currentState === "available"
240
+                || this.currentState === "unavailable")
241
+                return;
231
 
242
 
232
             buttonSelector.removeClass(this.baseClass + " active");
243
             buttonSelector.removeClass(this.baseClass + " active");
233
             buttonSelector.addClass(this.baseClass);
244
             buttonSelector.addClass(this.baseClass);
245
             setTimeout(function(){
256
             setTimeout(function(){
246
                 $('#recordingLabel').css({display: "none"});
257
                 $('#recordingLabel').css({display: "none"});
247
             }, 5000);
258
             }, 5000);
248
-        } else if (recordingState === 'pending') {
259
+        }
260
+        else if (recordingState === 'pending') {
249
 
261
 
250
             buttonSelector.removeClass(this.baseClass + " active");
262
             buttonSelector.removeClass(this.baseClass + " active");
251
             buttonSelector.addClass(this.baseClass);
263
             buttonSelector.addClass(this.baseClass);

Notiek ielāde…
Atcelt
Saglabāt