Skip to content

Commit

Permalink
fix: app crash on send first message in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
Barresi committed Feb 12, 2024
1 parent cedb469 commit 6a03acb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/chat/lib/group-chat-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const addMessageInGroupedMessagesByDate = (
newMessage: IMessage
): IFormattedMessages[] => {
const lastDateOfGroupMessages = new Date(
formattedMessages[formattedMessages.length - 1].date
formattedMessages[formattedMessages.length - 1]?.date
).toDateString()
const dateOfNewMessage = new Date(newMessage.createdAt).toDateString()
if (lastDateOfGroupMessages !== dateOfNewMessage) {
Expand Down

0 comments on commit 6a03acb

Please sign in to comment.