Comments (8)
Hello @andrnag and @MonstraG 👋
The related PR has been merged, so the issue is closed automatically.
The implemented fix is released on npm under version 1.2.1
🙂
Once again, thanks for help with this issue 🙌
from chat-widget-adapters.
@walaszczykm thank you! The fix is working. I have tested it today.
from chat-widget-adapters.
Hello @andrnag 👋
Thanks for the report. Sad to hear you have encountered an issue.
I have investigated it a little bit; thanks for pointing it out in the code btw 🙂
We cannot just guard the access of window.LiveChatWidget
global object access as it, of course, made the error go away but also the required action of destroying the current widget instance would not happen leading to uncontrolled behavior or even leakage of global variables and not cleaned up properly script tags or other HTML elements on the website.
What looks like a proper solution here is to prevent successive calls of init
and destroy
while the widget is in a loading state, as we cannot properly destroy it until it is fully loaded. Preserving the last desired state from the user's perspective would allow deciding after initialization if the widget should be present or not.
I have implemented a draft of this solution, testing it with react-router
and quickly repeated route changes as also as the consequent LiveChatWidget
component mounting and unmounting on interval.
In both cases everything worked very stable, without any error, and was not leaking any leftover HTML elements or global variables.
Here you can find a Draft PR with the changes: #53
Please let me know if it would be possible for you to test the locally built package from the branch and test it in your setup to confirm 100% that the issue is gone. I will support you at any moment if help is required 🙂
from chat-widget-adapters.
Thank you, Maciej!
I'll try to test it next week.
from chat-widget-adapters.
Also hit this problem, any progress?
Tested the branch out, problem doesn't occur there.
from chat-widget-adapters.
Hello! Unfortunately, I had no time to test this solution. I will try to get it this week. I'll post the results here.
from chat-widget-adapters.
@walaszczykm , can you release it as alpha/canary at least?
from chat-widget-adapters.
@MonstraG, I will finalize the PR, and we will proceed with the regular release. I just wanted to confirm that it properly solves the issue you have encountered 🙂 Thanks for the confirmation 🙌
from chat-widget-adapters.
Related Issues (20)
- Optimize external scripts HOT 2
- Color Change on react js HOT 1
- Question: How to use with Custom Identity Provider? HOT 2
- Set LiveChat Customer Avatar HOT 1
- Angular v15 update HOT 4
- Angular v15 update HOT 2
- Add SvelteKit Support HOT 1
- Intermittent white bar on bottom on mobile devices HOT 1
- Angular Adaptor Event Handlers
- uniapp require is not defined.
- hook to open the chat from a button or event
- Update window types
- Support Angular 16 HOT 1
- Programmatically start chat HOT 2
- asyncInit incorportation
- visibility="minimized" do hide chat icon in mobile view. HOT 1
- Cannot read properties of null (reading 'useRef')
- Hooks for interacting with the widget
- How to get baseAPI when use customIdentityProvider
- Minimised hides the vue chat widget, if the support is offline. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chat-widget-adapters.