This is an automated email from the ASF dual-hosted git repository. rusackas pushed a commit to branch scarf-pixel in repository https://gitbox.apache.org/repos/asf/superset.git
commit 64a60357f6176103ce38a17cc35b645f64d51eeb Author: Evan Rusackas <[email protected]> AuthorDate: Tue Nov 28 11:59:00 2023 -0700 questionable shim update --- superset-frontend/spec/helpers/shim.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/superset-frontend/spec/helpers/shim.tsx b/superset-frontend/spec/helpers/shim.tsx index 152fcc370c..1913b56546 100644 --- a/superset-frontend/spec/helpers/shim.tsx +++ b/superset-frontend/spec/helpers/shim.tsx @@ -48,15 +48,17 @@ if (defaultView != null) { } const g = global as any; -g.window = g.window || {}; -g.window.location = { href: 'about:blank' }; -g.window.performance = { now: () => new Date().getTime() }; -g.window.Worker = Worker; -g.window.IntersectionObserver = IntersectionObserver; -g.window.ResizeObserver = ResizeObserver; -g.window.featureFlags = {}; -g.URL.createObjectURL = () => ''; -g.caches = new CacheStorage(); +if (typeof window == 'undefined') { + g.window = {}; + g.window.location = { href: 'about:blank' }; + g.window.performance = { now: () => new Date().getTime() }; + g.window.Worker = Worker; + g.window.IntersectionObserver = IntersectionObserver; + g.window.ResizeObserver = ResizeObserver; + g.window.featureFlags = {}; + g.URL.createObjectURL = () => ''; + g.caches = new CacheStorage(); +} Object.defineProperty(window, 'matchMedia', { writable: true,
