Skip to content

Commit

Permalink
Fix Message.data is undefined
Browse files Browse the repository at this point in the history
`Message.data` was made optional in 4e3733f427fe70754dc36a6a9928182c79e81d72
  • Loading branch information
VeskeR committed Jul 17, 2024
1 parent 4e1cf6d commit 677c2c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CursorHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class CursorHistory {
const lastMessage = page.items.find((item) => item.connectionId === connectionId);
if (!lastMessage) return [connectionId, cursors];

const { data = [], clientId }: { data: OutgoingBuffer[] } & Pick<Message, 'clientId'> = lastMessage;
const { data = [], clientId }: { data?: OutgoingBuffer[] } & Pick<Message, 'clientId'> = lastMessage;

const lastPositionSet = data[data.length - 1]?.cursor;
const lastUpdate = lastPositionSet
Expand Down

0 comments on commit 677c2c6

Please sign in to comment.