Git Product home page Git Product logo

Comments (8)

walaszczykm avatar walaszczykm commented on July 29, 2024 2

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.

andrnag avatar andrnag commented on July 29, 2024 1

@walaszczykm thank you! The fix is working. I have tested it today.

from chat-widget-adapters.

walaszczykm avatar walaszczykm commented on July 29, 2024

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.

andrnag avatar andrnag commented on July 29, 2024

Thank you, Maciej!
I'll try to test it next week.

from chat-widget-adapters.

MonstraG avatar MonstraG commented on July 29, 2024

Also hit this problem, any progress?

Tested the branch out, problem doesn't occur there.

from chat-widget-adapters.

andrnag avatar andrnag commented on July 29, 2024

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.

MonstraG avatar MonstraG commented on July 29, 2024

@walaszczykm , can you release it as alpha/canary at least?

from chat-widget-adapters.

walaszczykm avatar walaszczykm commented on July 29, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.