Fix bug which prevented more than one event getting pinned

pull/21833/head
Michael Telatynski 2021-07-08 14:48:06 +01:00
parent 8e7e4c9e8d
commit f8907a6ea4
1 changed files with 1 additions and 1 deletions

View File

@ -179,7 +179,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
const room = cli.getRoom(this.props.mxEvent.getRoomId());
const eventId = this.props.mxEvent.getId();
const pinnedIds = room?.currentState?.getStateEvents(EventType.RoomPinnedEvents, "")?.pinned || [];
const pinnedIds = room?.currentState?.getStateEvents(EventType.RoomPinnedEvents, "")?.getContent().pinned || [];
if (pinnedIds.includes(eventId)) {
pinnedIds.splice(pinnedIds.indexOf(eventId), 1);
} else {