prevent harmless but annoying 404 errors for sound files when sound is off

This commit is contained in:
Alice Harris 2014-09-05 18:45:52 +10:00
parent 8961ac6198
commit 2350989dfb

View file

@ -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';