Skip to content

Commit

Permalink
fix: check for channel validity before consuming config (#2760)
Browse files Browse the repository at this point in the history
  • Loading branch information
isekovanic authored Nov 7, 2024
1 parent b9c49be commit ff53399
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ export const useLatestMessagePreview = <

useEffect(() => {
if (channelConfigExists) {
const read_events = channel.getConfig()?.read_events;
const read_events =
!channel.disconnected && !!channel?.id && channel.getConfig()?.read_events;
if (typeof read_events === 'boolean') {
setReadEvents(read_events);
}
Expand Down

0 comments on commit ff53399

Please sign in to comment.