Intercom opens automatically when state is completed
See original GitHub issueIf I understood the code correctly, when Intercom finishes loading https://github.com/calibreapp/react-live-chat-loader/blob/b80203308a7c106d079239a501b82b6b372a7143/src/hooks/useChat.ts#L89 state will be set to complete
and Intercom is opened automatically without user interaction.
Call to setting complete
state: https://github.com/calibreapp/react-live-chat-loader/blob/ab41513a6b29adebefef92415c4800948ce2f7a3/src/providers/intercom.ts#L57
This is very bad UX since on mobile Intercom pops up and takes the whole viewport when opened. Therefore, without any notice a new screen pops up for the user on mobile. I think it should be out of scope of this package to automatically open the Intercom window without user interaction involved or people calling window.Intercom('show')
on their code manually.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (6 by maintainers)
Top GitHub Comments
@mxstbr Sorry for the delay. I did “fix” it by moving Provider lower down in the tree. Basically, the parent component for LiveChat component (eg. Intercom) is now the LiveChatProvider on our setup. This ensures that the provider will be remounted while navigating and therefore the state I am mentioning on my first post will get reset.
We should, however, be able to to add the Provider higher up in the tree, but it is a workaround for now until somebody has time to fix the state issue especially on Intercom component.
I think I fixed it by setting
key={location.pathname}
, however it’s really difficult to verify as it only happens randomly. 😕