Description
When I create event handlers for user add, remove, update, it appears the callback function executes immediately upon the handler being created.
Browser Console Error
The callback function gets called when zoomClient.on(‘user-added’, callback) (and any other handler related to users) is created, even if a user was not added.
Which Web Video SDK version?
1.1.5
Video SDK Code Snippets
useEffect(() => { console.log(':: useParticipantsChange: useEffect'); zoomClient.on('user-added', () => callback('joined')); zoomClient.on('user-removed', () => callback('left')); zoomClient.on('user-updated', () => callback('updated')); return () => { zoomClient.off('user-added', callback); zoomClient.off('user-removed', callback); zoomClient.off('user-updated', callback); }; }, [zoomClient, callback]);
To Reproduce(If applicable)
Steps to reproduce the behavior:
- Reload page
- ALL of the event handlers get triggered immediately, but then also execute as expected on subsequent, real events.
Screenshots
Apparently I can’t embed?
Device (please complete the following information):
- Device: MacBook Pro
- OS: MacOS
- Browser: Chrome
- Browser Version: Latest
Additional context
As you can see, I want to update a status message only when a user joins, leaves or is updated. The screenshot shows when I first initiate the session – all three get triggered. If someone joins later, I get the proper “joined” message.