Skip to content

Commit 311b2bc

Browse files
authored
Merge pull request #82 from Wikia/fix-window
🐛 Not sure why this doesn't work
2 parents c17cde7 + 5aac13d commit 311b2bc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

source/utils/config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
function isClient() {
2+
return typeof window !== 'undefined';
3+
}
4+
15
function isFandomCom() {
2-
if (window && window.location && window.location.hostname) {
6+
if (isClient() && window.location && window.location.hostname) {
37
return window.location.hostname.includes('fandom.com');
48
}
59

@@ -13,6 +17,7 @@ const IS_PRODUCTION_APP = process.env.env === 'production';
1317
const SERVICES_BASE_URL = isFandomCom() ? 'https://services.fandom.com/' : 'https://services.fandom-dev.us/';
1418

1519
const config = {
20+
isClient,
1621
isFandomCom,
1722
IS_PRODUCTION_APP,
1823
SERVICES_BASE_URL,

0 commit comments

Comments
 (0)