Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/docs/chat/rooms/message-reactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ let messages = await room.messages.history({limit: 50});
// subscribe to message reactions summary events
room.messages.reactions.subscribe((event) => {
// find the relevant message (in practice: use binary search or a map for lookups)
const idx = messages.findLastIndex((msg) => msg.serial === event.messageSerial);
const idx = messages.findLastIndex((msg) => msg.serial === event.summary.messageSerial);
if (idx === -1) {
// not found
return;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/chat/rooms/messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ room.messages.subscribe((event) => {
room.messages.reactions.subscribe((event) => {
const idx = myMessageList.findIndex((msg) => msg.serial === event.summary.messageSerial);
if (idx !== -1) {
myMessageList[idx] = myMessageList[idx]with(event);
myMessageList[idx] = myMessageList[idx].with(event);
}
});
```
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/chat/rooms/presence.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To enter the presence set of a room, use the [`usePresence`](#set) hook instead.
<Code>
```javascript
const { unsubscribe } = room.presence.subscribe((event) => {
console.log(`${event.clientId} entered with data: ${event.data}`);
console.log(`${event.member.clientId} entered with data: ${event.member.data}`);
});
```

Expand Down