From 2350989dfb0e111a01f28f996a263d1af5db4464 Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Fri, 5 Sep 2014 18:45:52 +1000 Subject: [PATCH] prevent harmless but annoying 404 errors for sound files when sound is off --- public/js/controllers/rootCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/controllers/rootCtrl.js b/public/js/controllers/rootCtrl.js index 1582aecaae..cee9f992de 100644 --- a/public/js/controllers/rootCtrl.js +++ b/public/js/controllers/rootCtrl.js @@ -50,7 +50,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$ } $rootScope.playSound = function(id){ - if (!user.preferences.sound) return; + if (!user.preferences.sound || user.preferences.sound == 'off') return; var theme = user.preferences.sound; var file = 'audio/' + theme + '/' + id; document.getElementById('oggSource').src = file + '.ogg';