mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-01 11:03:18 +03:00
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:
commit
1889b5c281
1 changed files with 6 additions and 0 deletions
|
@ -398,6 +398,9 @@ export default React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
startPageChangeTimer() {
|
startPageChangeTimer() {
|
||||||
|
// Tor doesn't support performance
|
||||||
|
if (!performance || !performance.mark) return null;
|
||||||
|
|
||||||
// This shouldn't happen because componentWillUpdate and componentDidUpdate
|
// This shouldn't happen because componentWillUpdate and componentDidUpdate
|
||||||
// are used.
|
// are used.
|
||||||
if (this._pageChanging) {
|
if (this._pageChanging) {
|
||||||
|
@ -409,6 +412,9 @@ export default React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
stopPageChangeTimer() {
|
stopPageChangeTimer() {
|
||||||
|
// Tor doesn't support performance
|
||||||
|
if (!performance || !performance.mark) return null;
|
||||||
|
|
||||||
if (!this._pageChanging) {
|
if (!this._pageChanging) {
|
||||||
console.warn('MatrixChat.stopPageChangeTimer: timer not started');
|
console.warn('MatrixChat.stopPageChangeTimer: timer not started');
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue