even more nullchecks

This commit is contained in:
Kasper Rynning-Tønnesen
2018-07-01 21:46:14 +02:00
parent f8edd7c01a
commit 1cb88fa999

View File

@@ -22,6 +22,7 @@ var Hostcontroller = {
window.parentWindow.postMessage({type: "controller", id: id}, window.parentOrigin); window.parentWindow.postMessage({type: "controller", id: id}, window.parentOrigin);
} }
} else if(!embed) { } else if(!embed) {
if(window.location.pathname == "/") return;
document.querySelector("#code-text").innerText = id; document.querySelector("#code-text").innerText = id;
document.querySelector("#code-qr").setAttribute("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL); document.querySelector("#code-qr").setAttribute("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL);
document.querySelector("#code-link").setAttribute("href", codeURL); document.querySelector("#code-link").setAttribute("href", codeURL);
@@ -36,12 +37,15 @@ var Hostcontroller = {
if(client) return; if(client) return;
if(enabled){ if(enabled){
if(arr.type == "volume") { if(arr.type == "volume") {
Playercontrols.visualVolume(arr.value); try {
Player.setVolume(arr.value); Playercontrols.visualVolume(arr.value);
Player.soundcloud_player.setVolume(arr.value / 100); Player.setVolume(arr.value);
localStorage.setItem("volume", arr.value); Player.soundcloud_player.setVolume(arr.value / 100);
Playercontrols.choose_button(arr.value, false); localStorage.setItem("volume", arr.value);
Playercontrols.choose_button(arr.value, false);
} catch(e) {}
} else if(arr.type == "channel") { } else if(arr.type == "channel") {
if(window.location.pathname == "/") return;
socket.emit("change_channel"); socket.emit("change_channel");
Admin.beginning = true; Admin.beginning = true;