Merge pull request #1942 from matrix-org/luke/fix-perf-unsupported-tor

Add null-guard to support browsers that don't support performance
This commit is contained in:
David Baker 2018-06-04 16:39:55 +01:00 committed by GitHub
commit 1889b5c281
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -398,6 +398,9 @@ export default React.createClass({
},
startPageChangeTimer() {
// Tor doesn't support performance
if (!performance || !performance.mark) return null;
// This shouldn't happen because componentWillUpdate and componentDidUpdate
// are used.
if (this._pageChanging) {
@ -409,6 +412,9 @@ export default React.createClass({
},
stopPageChangeTimer() {
// Tor doesn't support performance
if (!performance || !performance.mark) return null;
if (!this._pageChanging) {
console.warn('MatrixChat.stopPageChangeTimer: timer not started');
return;