Store read pinned events as an array to avoid racing saves.
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
4f6cd6b23a
commit
3656fdb571
2 changed files with 10 additions and 9 deletions
|
@ -157,9 +157,9 @@ module.exports = React.createClass({
|
|||
|
||||
const readPinsEvent = this.props.room.getAccountData("im.vector.room.read_pins");
|
||||
if (readPinsEvent) {
|
||||
const lastReadEvent = readPinsEvent.getContent().last_read_id;
|
||||
if (lastReadEvent) {
|
||||
return currentPinEvent.getId() !== lastReadEvent;
|
||||
const readStateEvents = readPinsEvent.getContent().event_ids;
|
||||
if (readStateEvents) {
|
||||
return !readStateEvents.includes(currentPinEvent.getId());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue