Skip to content

Commit aa87aaf

Browse files
authored
Filter events before playing instead of before queuing
The previous way didn't quite work. Now the filtering is much more noticeable and instantaneous, right after setting `ULTIMATE_DREAM_KILLER = true`.
1 parent aaa0961 commit aa87aaf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/public/js/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var socket = io(document.location.hostname);
3636
socket.on('github', function (data) {
3737
$('.online-users-count').html(data.connected_users);
3838
data.data.forEach(function(event){
39-
if(!isEventInQueue(event) || shouldEventBeIgnored(event)){
39+
if(!isEventInQueue(event)){
4040
eventQueue.push(event);
4141
}
4242
});
@@ -233,7 +233,7 @@ function playSound(size, type) {
233233

234234
function playFromQueueExchange1(){
235235
var event = eventQueue.shift();
236-
if(event != null && event.message != null && svg != null){
236+
if(event != null && event.message != null && !shouldEventBeIgnored(event) && svg != null){
237237
playSound(event.message.length*1.1, event.type);
238238
if(!document.hidden)
239239
drawEvent(event, svg);
@@ -244,7 +244,7 @@ function playFromQueueExchange1(){
244244

245245
function playFromQueueExchange2(){
246246
var event = eventQueue.shift();
247-
if(event != null && event.message != null && svg != null){
247+
if(event != null && event.message != null && !shouldEventBeIgnored(event) && svg != null){
248248
playSound(event.message.length, event.type);
249249
if(!document.hidden)
250250
drawEvent(event, svg);

0 commit comments

Comments
 (0)