Skip to content

Commit

Permalink
Fix an edge case with incorrect Wiki button injection in social story…
Browse files Browse the repository at this point in the history
…let.
  • Loading branch information
lensvol committed Aug 12, 2022
1 parent f14dd3c commit 984d645
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@
if (otherButtons.length > 0) {
otherButtons[0].parentElement.insertBefore(wikiButton, otherButtons[0]);
} else {
container.insertBefore(wikiButton, container.firstChild);
let rootFrequencyHolder = container.querySelector("div[class='storylet-root__frequency']")
if (!rootFrequencyHolder) {
rootFrequencyHolder = document.createElement("div");
rootFrequencyHolder.classList.add("storylet-root__frequency");
container.insertBefore(rootFrequencyHolder, container.firstChild);
}

//container.insertBefore(wikiButton, container.firstChild);
rootFrequencyHolder.appendChild(wikiButton);
}
}
}
Expand Down

0 comments on commit 984d645

Please sign in to comment.