From 5aac13d0c480c36c17e615ef4eff871fec7029c0 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 18 Apr 2019 13:20:24 -0700 Subject: [PATCH] :bug: Not sure why this doesn't work --- source/utils/config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/utils/config.js b/source/utils/config.js index 1bc99c77..8a07fe34 100644 --- a/source/utils/config.js +++ b/source/utils/config.js @@ -1,5 +1,9 @@ +function isClient() { + return typeof window !== 'undefined'; +} + function isFandomCom() { - if (window && window.location && window.location.hostname) { + if (isClient() && window.location && window.location.hostname) { return window.location.hostname.includes('fandom.com'); } @@ -13,6 +17,7 @@ const IS_PRODUCTION_APP = process.env.env === 'production'; const SERVICES_BASE_URL = isFandomCom() ? 'https://services.fandom.com/' : 'https://services.fandom-dev.us/'; const config = { + isClient, isFandomCom, IS_PRODUCTION_APP, SERVICES_BASE_URL,