You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Cap the read pin event IDs to 10
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
@@ -83,6 +83,10 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
if (!readStateEvents.includes(pinnedEvents.getId())) {
|
if (!readStateEvents.includes(pinnedEvents.getId())) {
|
||||||
readStateEvents.push(pinnedEvents.getId());
|
readStateEvents.push(pinnedEvents.getId());
|
||||||
|
|
||||||
|
// Only keep the last 10 event IDs to avoid infinite growth
|
||||||
|
readStateEvents = readStateEvents.reverse().splice(0, 10).reverse();
|
||||||
|
|
||||||
MatrixClientPeg.get().setRoomAccountData(this.props.room.roomId, "im.vector.room.read_pins", {
|
MatrixClientPeg.get().setRoomAccountData(this.props.room.roomId, "im.vector.room.read_pins", {
|
||||||
event_ids: readStateEvents,
|
event_ids: readStateEvents,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user