Toggles the visibility of the chat modal based on the current state and event settings.

The options for the clickChat function.

Indicates if the messages modal is currently visible.

Function to update the visibility state of the messages modal.

The chat setting for the event, which can be "allow" or other values.

The participant's level, where "2" indicates a level that allows chat.

Optional function to show an alert message.

A promise that resolves when the operation is complete.

This function checks the current visibility state of the messages modal. If it is already visible, it will hide the modal. If it is not visible, it checks the chat settings and the participant's level to determine whether to show an alert indicating that chat is disabled or to display the chat modal.

const options: ClickChatOptions = {
isMessagesModalVisible: false,
updateIsMessagesModalVisible: (visible) => console.log(`Modal is now ${visible ? 'visible' : 'hidden'}`),
chatSetting: 'allow',
islevel: '1',
showAlert: (alert) => console.log(`Alert: ${alert.message}`),
};

const clickChatService = new ClickChat();
await clickChatService.clickChat(options);

Constructors

Methods

Constructors

Methods