You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Add null-guard to support browsers that don't support performance
Like Tor. Fixes https://github.com/vector-im/riot-web/issues/6781
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user