Merge pull request #97 from hueyy/fix/avoid_adding_class
Fix: avoid adding class; use variable instead
This commit is contained in:
commit
6e50c48eef
1 changed files with 4 additions and 4 deletions
|
@ -147,14 +147,14 @@ function initInjections() {
|
|||
* @returns {void}
|
||||
*/
|
||||
async function init() {
|
||||
const MASTODON_INJECTED_CLASS = "mastodon-simplified-federation-injected";
|
||||
|
||||
if (document.body.classList.contains(MASTODON_INJECTED_CLASS)) {
|
||||
if (typeof MASTODON_INJECTED_CLASS === "undefined"){
|
||||
// eslint-disable-next-line vars-on-top, no-var
|
||||
var MASTODON_INJECTED_CLASS = true;
|
||||
} else {
|
||||
// init has already run
|
||||
return;
|
||||
}
|
||||
|
||||
document.body.classList.add(MASTODON_INJECTED_CLASS);
|
||||
initInjections();
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue