-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -115,7 +114,6 @@ export function Notifications() { | |||
ToastManager.addToast({ | |||
title: `You are now a ${notification.data.roleName}`, | |||
}); | |||
updateRoomLayoutForRole?.(notification.data.roleName); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
No description provided.