Skip to content

Commit 84537ea

Browse files
committed
fix: white screen on opening channel from PN
1 parent 1caaf15 commit 84537ea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/SampleApp/src/screens/ChannelScreen.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ export const ChannelScreen: React.FC<ChannelScreenProps> = ({
129129
}
130130

131131
const newChannel = chatClient?.channel('messaging', channelId);
132-
if (!newChannel?.initialized) {
133-
await newChannel?.watch();
132+
try {
133+
if (!newChannel?.initialized) {
134+
await newChannel?.watch();
135+
}
136+
} catch(error) {
137+
console.log('An error has occurred while watching the channel: ', error);
134138
}
135139
setChannel(newChannel);
136140
};

0 commit comments

Comments
 (0)