From 9eaac8d236fa6198cb5db4dba949e28084cb3dde Mon Sep 17 00:00:00 2001 From: "Vaidas Kublinskas (dragonofdeath)" Date: Tue, 30 Jul 2024 11:44:06 +0300 Subject: [PATCH] Fix 'global' is undefined exception in browser env When trying to use pro-gallery in browser app in non-wix environment the library load fails with 'global is undefined' exception as its not defined in general case. --- packages/lib/src/common/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/src/common/utils/index.js b/packages/lib/src/common/utils/index.js index 0d930248e..c16664e85 100644 --- a/packages/lib/src/common/utils/index.js +++ b/packages/lib/src/common/utils/index.js @@ -324,7 +324,7 @@ class Utils { // TODO : Replace with isPrerender mode isSSR() { - return typeof global?.window === 'undefined'; + return typeof global !== 'undefined' && typeof global?.window === 'undefined'; } isOOI() {