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

fix: role change not happening from broadcaster to hls #3291

Closed
wants to merge 7 commits into from

Conversation

amar-1995
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 7:06am
storybook-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 7:06am

@@ -115,7 +114,6 @@ export function Notifications() {
ToastManager.addToast({
title: `You are now a ${notification.data.roleName}`,
});
updateRoomLayoutForRole?.(notification.data.roleName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this not working? is the role not correct here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In some scenarios, we are not getting useIsNotification or the notification is itself is empty. So this will never reach.


export const RoleChangeNotification = () => {
const notification = useHMSNotifications(HMSNotificationTypes.ROLE_UPDATED);
const isNotificationDisabled = useIsNotificationDisabled();
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is probably not required as it is handled in parent component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought to completely remove it from the parent and handle everything in this file as it will be single point if anything happens when the roleChange notification arrives.

Copy link
Collaborator

Choose a reason for hiding this comment

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

no it should be at the parent as single point, not in each individual component

const updateRoomLayoutForRole = useUpdateRoomLayout();

useEffect(() => {
if (notification && !isNotificationDisabled) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this condition is not required. we anyways get this only for local peer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

do we get the notification for all peers here?

title: `You are now a ${notification.data.roleName}`,
});
}
if (notification && notification.data?.isLocal && notification.data?.roleName) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

isLocal check also should not be needed.

const updateRoomLayoutForRole = useUpdateRoomLayout();

useEffect(() => {
if (notification && !isNotificationDisabled) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why will this work and not the earlier implementation? i don't see a clear difference.

@raviteja83 raviteja83 closed this Oct 8, 2024
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.

3 participants