-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feat(next speaker notification) #14904
Conversation
Hi, thanks for your contribution! |
108008b
to
3e09b0c
Compare
8a74a71
to
0fd660f
Compare
7e4e79a
to
3d4918e
Compare
adee0df
to
2937093
Compare
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.
One minor comment about always returning a boolean and we are good to go!
case NOTIFIED_TO_SPEAK: { | ||
return { | ||
...state, | ||
raisedHandsQueue: state.raisedHandsQueue.map((item, index) => { |
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.
Great work!
...state, | ||
raisedHandsQueue: state.raisedHandsQueue.map((item, index) => { | ||
if (index === 0) { | ||
return { ...item, |
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.
You don't need to clone the item entirely, since we only depend on the queue being unique, but it won't hurt either.
2937093
to
2acee8b
Compare
Hi Saghul @saghul, I have completed the code updates. Please let me know if any further actions are required. Thanks! |
export function hasBeenNotified(state: IReduxState): boolean { | ||
const raisedHandsQueue = state['features/base/participants'].raisedHandsQueue; | ||
|
||
return Boolean(raisedHandsQueue[0].hasBeenNotified); |
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 would check here if the first element exists, like you did above with the optional chaining operator, otherwise it would throw an error
2acee8b
to
cc15ba3
Compare
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.
🔥
Hi reviewer,
This pull request added the next speaker notification feature to the web application. However, the variable naming is a problem. If you have good ideas about the naming, please let me know.