Skip to content

Commit 4ae9dce

Browse files
authored
fix: always watch channel before passing to channel component (#1869)
1 parent d283267 commit 4ae9dce

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/SampleApp/src/screens/ChannelScreen.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,10 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({
121121
if (!chatClient || !channelId) return;
122122

123123
const newChannel = chatClient?.channel('messaging', channelId);
124-
setChannel(newChannel);
125-
126124
if (!newChannel?.initialized) {
127125
await newChannel?.watch();
128126
}
127+
setChannel(newChannel);
129128
};
130129

131130
initChannel();

0 commit comments

Comments
 (0)