Skip to content

Commit

Permalink
fix: check for channel validity before consuming config
Browse files Browse the repository at this point in the history
  • Loading branch information
isekovanic committed Nov 6, 2024
1 parent 5052d03 commit d66f5c3
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 d66f5c3

Please sign in to comment.