Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(react-native): Advanced: Chat Integration - Chat in Video #854

Merged
merged 8 commits into from
Jul 27, 2023

Conversation

khushal87
Copy link
Member

No description provided.

}, [client, cid]);

useEffect(() => {
if (!client || !channelWatched) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont see the use case of channelWatched prop actually..

if the channel is not watched, it wont be inside activeChannels and so handleevent will set a count of 0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just a security check to avoid bugs if the channel is not watched. Good to have it for now I think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no please, lets make it simpler

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a security check to avoid bugs if the channel is not watched.

we an add a note for that.. lets strive to make it simpler

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the hook

Comment on lines +245 to +246
const newChannel = await client.channel(CHANNEL_TYPE, CHANNEL_ID);
setChannel(newChannel);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant we just watch here instead of useChannelWatch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this simplifies it

Copy link
Member

@santhoshvai santhoshvai Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also why await here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and there is no need to create the channel ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client.channel creates a channel automatically if not created. We created the channel already in the ChatScreen

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@santhoshvai santhoshvai Jul 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khushal87 you have linked, but please read the link

we must call channel.create() or channel.watch()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved since we call channel.watch(), we discussed yesterday.

Copy link
Member

@santhoshvai santhoshvai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please read the comments

Comment on lines 82 to 83
import { VideoCallUI } from './components/VideoCallUI';
import { ChatWrapper } from './src/components/ChatWrapper';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { VideoCallUI } from './components/VideoCallUI';
import { ChatWrapper } from './src/components/ChatWrapper';
import { VideoCallUI } from 'src/components/VideoCallUI';
import { ChatWrapper } from 'src/components/ChatWrapper';

@sonarcloud
Copy link

sonarcloud bot commented Jul 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@santhoshvai santhoshvai merged commit 9acd99a into main Jul 27, 2023
13 of 15 checks passed
@santhoshvai santhoshvai deleted the khushal87/advanced/chat-integration/chat-in-video branch July 27, 2023 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants