You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Cache hidden events setting
Settings is too expensive to query in a hot code path, so this caches the value on the MessagePanel component instead.
This commit is contained in:
@ -152,6 +152,11 @@ module.exports = React.createClass({
|
|||||||
// Velocity requires
|
// Velocity requires
|
||||||
this._readMarkerGhostNode = null;
|
this._readMarkerGhostNode = null;
|
||||||
|
|
||||||
|
// Cache hidden events setting on mount since Settings is expensive to
|
||||||
|
// query, and we check this in a hot code path.
|
||||||
|
this._showHiddenEventsInTimeline =
|
||||||
|
SettingsStore.getValue("showHiddenEventsInTimeline");
|
||||||
|
|
||||||
this._isMounted = true;
|
this._isMounted = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -292,7 +297,7 @@ module.exports = React.createClass({
|
|||||||
return false; // ignored = no show (only happens if the ignore happens after an event was received)
|
return false; // ignored = no show (only happens if the ignore happens after an event was received)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SettingsStore.getValue("showHiddenEventsInTimeline")) {
|
if (this._showHiddenEventsInTimeline) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user