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}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
async function init() {
|
async function init() {
|
||||||
const MASTODON_INJECTED_CLASS = "mastodon-simplified-federation-injected";
|
if (typeof MASTODON_INJECTED_CLASS === "undefined"){
|
||||||
|
// eslint-disable-next-line vars-on-top, no-var
|
||||||
if (document.body.classList.contains(MASTODON_INJECTED_CLASS)) {
|
var MASTODON_INJECTED_CLASS = true;
|
||||||
|
} else {
|
||||||
// init has already run
|
// init has already run
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.body.classList.add(MASTODON_INJECTED_CLASS);
|
|
||||||
initInjections();
|
initInjections();
|
||||||
|
|
||||||
const observer = new MutationObserver(() => {
|
const observer = new MutationObserver(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue