We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8efdf17 + f5afd6d commit 994b6b0Copy full SHA for 994b6b0
src/helpers/is-browser.ts
@@ -1,7 +1,9 @@
1
+import { PUBLIC_ENV_KEY } from '../script/constants';
2
+
3
/**
4
* Checks if the code is running in the browser.
5
*/
6
export function isBrowser() {
7
// eslint-disable-next-line no-underscore-dangle
- return Boolean(typeof window !== 'undefined' && window.__ENV);
8
+ return Boolean(typeof window !== 'undefined' && window[PUBLIC_ENV_KEY]);
9
}
0 commit comments