mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Null check before accessing _paq
This commit is contained in:
parent
22f2d6f292
commit
3ba51ba695
@ -164,13 +164,6 @@ class Analytics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trackPageChange(generationTimeMs) {
|
trackPageChange(generationTimeMs) {
|
||||||
if (typeof generationTimeMs === 'number') {
|
|
||||||
this._paq.push(['setGenerationTimeMs', generationTimeMs]);
|
|
||||||
} else {
|
|
||||||
console.warn('Analytics.trackPageChange: expected generationTimeMs to be a number');
|
|
||||||
// But continue anyway because we still want to track the change
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.disabled) return;
|
if (this.disabled) return;
|
||||||
if (this.firstPage) {
|
if (this.firstPage) {
|
||||||
// De-duplicate first page
|
// De-duplicate first page
|
||||||
@ -178,6 +171,14 @@ class Analytics {
|
|||||||
this.firstPage = false;
|
this.firstPage = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof generationTimeMs === 'number') {
|
||||||
|
this._paq.push(['setGenerationTimeMs', generationTimeMs]);
|
||||||
|
} else {
|
||||||
|
console.warn('Analytics.trackPageChange: expected generationTimeMs to be a number');
|
||||||
|
// But continue anyway because we still want to track the change
|
||||||
|
}
|
||||||
|
|
||||||
this._paq.push(['setCustomUrl', getRedactedUrl()]);
|
this._paq.push(['setCustomUrl', getRedactedUrl()]);
|
||||||
this._paq.push(['trackPageView']);
|
this._paq.push(['trackPageView']);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user