Skip to content

Commit

Permalink
regression: fix issue with triggers (#29073)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchoeler authored and sampaiodiego committed May 2, 2023
1 parent 4cb7944 commit d789832
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/livechat/src/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const getLastReadMessage = () => {
: renderedMessages
.slice()
.reverse()
.find((item) => item.u._id === user._id);
.find((item) => item.u._id === user?._id);
};

export const getUnreadMessages = () => {
Expand All @@ -95,7 +95,7 @@ export const getUnreadMessages = () => {
: renderedMessages
.slice()
.reverse()
.findIndex((item) => item.u._id === user._id);
.findIndex((item) => item.u._id === user?._id);

if (lastReadMessageIndex !== -1) {
const unreadMessages = renderedMessages.slice(lastReadMessageIndex + 1).filter((message) => message.u._id !== user._id);
Expand Down

0 comments on commit d789832

Please sign in to comment.