From 37139d8aac10bd13758f52e3d361f3d017c4ad46 Mon Sep 17 00:00:00 2001 From: apolinario Date: Sat, 10 Dec 2022 12:51:40 +0100 Subject: [PATCH] No code repeat --- script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index 1c8fcbf1f..9748ec90e 100644 --- a/script.js +++ b/script.js @@ -1,5 +1,6 @@ -function gradioApp(){ - return !!document.getElementsByTagName('gradio-app')[0].shadowRoot ? document.getElementsByTagName('gradio-app')[0].shadowRoot : document; +function gradioApp() { + const gradioShadowRoot = document.getElementsByTagName('gradio-app')[0].shadowRoot + return !!gradioShadowRoot ? gradioShadowRoot : document; } function get_uiCurrentTab() {