mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Fix bug that caused crash when analytics HS/IS whitelists not specified
This commit is contained in:
parent
665e052596
commit
5da62c6ad9
@ -190,6 +190,7 @@ class Analytics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setVisitVariable(key, value) {
|
_setVisitVariable(key, value) {
|
||||||
|
if (this.disabled) return;
|
||||||
this._paq.push(['setCustomVariable', customVariables[key].id, key, value, 'visit']);
|
this._paq.push(['setCustomVariable', customVariables[key].id, key, value, 'visit']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,8 +200,8 @@ class Analytics {
|
|||||||
const config = SdkConfig.get();
|
const config = SdkConfig.get();
|
||||||
if (!config.piwik) return;
|
if (!config.piwik) return;
|
||||||
|
|
||||||
const whitelistedHSUrls = config.piwik.whitelistedHSUrls;
|
const whitelistedHSUrls = config.piwik.whitelistedHSUrls || [];
|
||||||
const whitelistedISUrls = config.piwik.whitelistedISUrls;
|
const whitelistedISUrls = config.piwik.whitelistedISUrls || [];
|
||||||
|
|
||||||
this._setVisitVariable('User Type', isGuest ? 'Guest' : 'Logged In');
|
this._setVisitVariable('User Type', isGuest ? 'Guest' : 'Logged In');
|
||||||
this._setVisitVariable('Homeserver URL', whitelistRedact(whitelistedHSUrls, homeserverUrl));
|
this._setVisitVariable('Homeserver URL', whitelistRedact(whitelistedHSUrls, homeserverUrl));
|
||||||
|
Loading…
Reference in New Issue
Block a user