diff --git a/js/global_scope_js.js b/js/global_scope_js.js index eff91156..ebed1f3d 100644 --- a/js/global_scope_js.js +++ b/js/global_scope_js.js @@ -354,22 +354,21 @@ function handleMorphdomUpdate(data) { // Wait for Gradio to finish setting its styles, then force dark theme const observer = new MutationObserver((mutations) => { - mutations.forEach((mutation) => { - if (mutation.type === 'attributes' && - mutation.target.tagName === 'GRADIO-APP' && - mutation.attributeName === 'style') { + mutations.forEach((mutation) => { + if (mutation.type === "attributes" && + mutation.target.tagName === "GRADIO-APP" && + mutation.attributeName === "style") { - // Gradio just set its styles, now force dark theme - document.body.classList.add('dark'); - - observer.disconnect(); - } - }); + // Gradio just set its styles, now force dark theme + document.body.classList.add("dark"); + observer.disconnect(); + } + }); }); // Start observing observer.observe(document.documentElement, { - attributes: true, - subtree: true, - attributeFilter: ['style'] + attributes: true, + subtree: true, + attributeFilter: ["style"] });