Wait for window.opts.arh_javascript_aspect_ratio_show before disconnecting observer #61 (#63)

This commit is contained in:
thomas
2023-06-04 16:39:07 +01:00
committed by GitHub
parent 0bccd48788
commit 99fcf9b0a4

View File

@@ -398,7 +398,7 @@ class AspectRatioController {
const heightContainer = gradioApp().querySelector(`#${page}_height`);
// wait for width and height containers to exist.
if (widthContainer && heightContainer) {
if (widthContainer && heightContainer && window.opts && window.opts.arh_javascript_aspect_ratio_show !== undefined) {
observer.disconnect();
if (!window.opts.arh_javascript_aspect_ratio_show) {
return;