fix: secoia intl

This commit is contained in:
Jean-Baptiste Pasquier 2021-06-23 13:35:16 +02:00
parent 6d4224fae6
commit 239eb2224b
1 changed files with 5 additions and 1 deletions

View File

@ -257,7 +257,7 @@ window.orbit.intl = new JsI18n;
document.addEventListener("DOMContentLoaded", () => {
// Detect the lang & initialize, based on the browser or "language" item from localstorage
window.orbit.intl.detectLanguage();
let timer;
let timer, timer2;
(new MutationObserver((mutations) => {
mutations.forEach(mutation => {
if (mutation.target.attributes["data-trans"] != null) {
@ -267,6 +267,10 @@ document.addEventListener("DOMContentLoaded", () => {
clearTimeout(timer);
timer = setTimeout(() => window.orbit.intl.processNode(document.querySelector('body')), 500);
}
// Hotfix for Secoia
if (mutation.target.nodeName == "SOLID-DIRECTORY") {
if(!timer2) timer2 = setTimeout(() => mutation.target.render(), 500);
}
});
}).observe(document.body, {
subtree: true,