fix js errors when restarting UI
This commit is contained in:
parent
5623a3e7b1
commit
6ffefdcc9f
|
@ -1,5 +1,6 @@
|
|||
function gradioApp() {
|
||||
const gradioShadowRoot = document.getElementsByTagName('gradio-app')[0].shadowRoot
|
||||
const elems = document.getElementsByTagName('gradio-app')
|
||||
const gradioShadowRoot = elems.length == 0 ? null : elems[0].shadowRoot
|
||||
return !!gradioShadowRoot ? gradioShadowRoot : document;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue