diff --git a/js/UtteranceQueue.ts b/js/UtteranceQueue.ts index ce8ae4b..4c02503 100644 --- a/js/UtteranceQueue.ts +++ b/js/UtteranceQueue.ts @@ -331,12 +331,11 @@ class UtteranceQueue extends PhetioObject { } } - // This side effect is to make sure that the timeInQueue is transferred between adding the same Utterance. if ( times.length >= 1 ) { utteranceWrapper.timeInQueue = Math.max( ...times ); } - // remove all occurrences, if applicable. + // remove all occurrences, if applicable. This side effect is to make sure that the timeInQueue is transferred between adding the same Utterance. const removedWrappers = _.remove( this.queue, currentUtteranceWrapper => currentUtteranceWrapper.utterance === utteranceWrapper.utterance ); this.removePriorityListeners( removedWrappers ); }