From b1af4ec9fd82fbafb27c23e941b984253e960463 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 26 Apr 2018 14:30:27 +0100 Subject: [PATCH] Fix Analytics to not import DEFAULTS, therefore avoiding NPE --- src/Analytics.js | 6 +++--- src/SdkConfig.js | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Analytics.js b/src/Analytics.js index a95e6ee0e9..d48372afd7 100644 --- a/src/Analytics.js +++ b/src/Analytics.js @@ -16,7 +16,7 @@ import { getCurrentLanguage, _t, _td } from './languageHandler'; import PlatformPeg from './PlatformPeg'; -import SdkConfig, { DEFAULTS } from './SdkConfig'; +import SdkConfig from './SdkConfig'; import Modal from './Modal'; import sdk from './index'; @@ -199,8 +199,8 @@ class Analytics { const config = SdkConfig.get(); if (!config.piwik) return; - const whitelistedHSUrls = config.piwik.whitelistedHSUrls || DEFAULTS.piwik.whitelistedHSUrls; - const whitelistedISUrls = config.piwik.whitelistedISUrls || DEFAULTS.piwik.whitelistedISUrls; + const whitelistedHSUrls = config.piwik.whitelistedHSUrls; + const whitelistedISUrls = config.piwik.whitelistedISUrls; this._setVisitVariable('User Type', isGuest ? 'Guest' : 'Logged In'); this._setVisitVariable('Homeserver URL', whitelistRedact(whitelistedHSUrls, homeserverUrl)); diff --git a/src/SdkConfig.js b/src/SdkConfig.js index 92b4e325e9..8df725a913 100644 --- a/src/SdkConfig.js +++ b/src/SdkConfig.js @@ -45,4 +45,3 @@ class SdkConfig { } module.exports = SdkConfig; -module.exports.DEFAULTS = DEFAULTS;