blip-chat-widget icon indicating copy to clipboard operation
blip-chat-widget copied to clipboard

Is this possible to use something like withEventHandler but for new messages?

Open robsonbbs opened this issue 2 years ago • 0 comments

Hi, I am using this widget without the traditional bubble button, instead, users use a custom button managed by my frontend and when they leave the chat I am doing something like this to hide the widget:

.withEventHandler(BlipChat.LEAVE_EVENT, () => {
      document.querySelector('#blip-chat-open-iframe').style.display = 'none'
})

The problem is: When my support team sends a new message if the user already closed the chat they need to tap my custom button again to check if there is any new message. What I would like to do is automatically reopens the chat after receiving a new message, this way I would call users' attention and they would know that there is a new message to them.

I know that I can use something like this to reopen the chat:

const toogleChat = () => {
    clientRef.current.toogleChat()
}

But how to trigger that once a new message was received?

robsonbbs avatar Jul 07 '22 20:07 robsonbbs