This method allows you to update the co-host for a chat room, set their responsibilities,
and emit the relevant changes to the server. It also handles demo mode restrictions.
Param: options
The options for modifying co-host settings.
Param: options.roomName
The name of the room.
Param: options.showAlert
Function to show an alert message.
Param: options.selectedParticipant
The participant selected to be co-host.
Param: options.coHost
The current co-host.
Param: options.coHostResponsibility
The responsibilities assigned to the co-host.
Param: options.updateIsCoHostModalVisible
Function to update the visibility of the co-host modal.
Param: options.updateCoHostResponsibility
Function to update the co-host responsibility.
Param: options.updateCoHost
Function to update the co-host.
Param: options.socket
The socket instance for emitting events.
Returns
A promise that resolves when the co-host settings have been modified.
Remarks
If the room is in demo mode (room name starts with "d"), co-host cannot be added and an alert is shown.
If a valid participant is selected, they are set as the new co-host.
The co-host responsibility is updated.
A socket event is emitted to update the co-host information.
The co-host modal is closed after updating the settings.
Modifies the co-host settings for a given room.
This method allows you to update the co-host for a chat room, set their responsibilities, and emit the relevant changes to the server. It also handles demo mode restrictions.
Param: options
The options for modifying co-host settings.
Param: options.roomName
The name of the room.
Param: options.showAlert
Function to show an alert message.
Param: options.selectedParticipant
The participant selected to be co-host.
Param: options.coHost
The current co-host.
Param: options.coHostResponsibility
The responsibilities assigned to the co-host.
Param: options.updateIsCoHostModalVisible
Function to update the visibility of the co-host modal.
Param: options.updateCoHostResponsibility
Function to update the co-host responsibility.
Param: options.updateCoHost
Function to update the co-host.
Param: options.socket
The socket instance for emitting events.
Returns
A promise that resolves when the co-host settings have been modified.
Remarks
Example