Fixed SOMtonight not working after login

This commit is contained in:
Arne van Iterson 2019-11-22 16:16:18 +01:00
parent 40a469de0e
commit faeffc41e6
1 changed files with 8 additions and 8 deletions

View File

@ -7,6 +7,14 @@ function changeSlogan(message)
} else {
tonight = message[0];
slogans = message[1];
// Set theme
console.log(tonight);
if (tonight) {
var cssUrl = browser.runtime.getURL("content/css/index.css");
var cssTag = `<link rel='stylesheet' href='${cssUrl}'>`;
document.head.innerHTML += cssTag;
}
// Select random slogan
console.log(`Loaded ${slogans.length} slogans`);
@ -44,14 +52,6 @@ function changeSlogan(message)
// Add a little credit
document.querySelectorAll('footer > span')[0].innerHTML = "Somtodayn't is een add-on door McArn.";
// Set theme
console.log(tonight);
if (tonight) {
var cssUrl = browser.runtime.getURL("content/css/index.css");
var cssTag = `<link rel='stylesheet' href='${cssUrl}'>`;
document.body.innerHTML += cssTag;
}
}
}