Skip to content

Commit

Permalink
fix: load channel at the very end when messageId is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
khushal87 committed Oct 14, 2024
1 parent 69bba7b commit 53d487f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/src/components/Channel/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,8 @@ const ChannelWithContext = <
}
// If the messageId is undefined and the last message and the current message id do not match we load the channel at the very bottom.
else if (
channel.state.messages[channel.state.messages.length - 1].id !==
channel.state.latestMessages[channel.state.latestMessages.length - 1].id &&
channel.state.messages?.[channel.state.messages.length - 1]?.id !==
channel.state.latestMessages?.[channel.state.latestMessages.length - 1]?.id &&
!messageId
) {
await loadChannel();
Expand Down

0 comments on commit 53d487f

Please sign in to comment.