onToggleWidget()
I would like to detect when the chat widget is toggled. We have a method to toggle the widget, toggleWidget(), and we can use isWidgetOpened() to find the status of the toggle, but there is no event to attach to to know when that happens.
One option is to add a onToggleWidget() property, and with a little direction I can put that into a pull request.
Another option might be to use a custom launcher that duplicates the default launcher in appearance, but that calls a function that first calls the supplied handleToggle method and then calls isWidgetOpened().
Any feedback would be appreciated.
any update on this? i would really like to have this functionality too
I figured this out on my own, but never put it into a PR. I'll try to get to that.
@mschersten can you please share your workaround with me. Would really appreciate it.
I just added a PR: https://github.com/Wolox/react-chat-widget/pull/231
I'll leave this open for now, but hopefully it will be merged into the project and we can close this.
Hi @mschersten
I want to use your PR changes on my project.
I cloned your change branch and built it successfully. But when I use them, I have following error.
What is error?
Have you tried cloning this main repo and including it in the same way, or have you used it only through npm and this is your first attempt at cloning the project? I don't think your errors have anything to do with my changes, I only changed a few lines.
There is an issue with my PR, though, that the handleToggle() method is only called when the user clicks on the loader, not when toggleWidget() is called. If anyone more familiar with React/Redux can advise it would be appreciated.