Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinitialisation scheduling #53

Merged
merged 3 commits into from
Sep 5, 2022

Conversation

walaszczykm
Copy link
Collaborator

@walaszczykm walaszczykm commented Aug 12, 2022

Type of change

  • Docs
  • Bug fix
  • Feature

Packages

  • @livechat/widget-core
  • @livechat/widget-react
  • @livechat/widget-vue
  • @livechat/widget-angular

Issue

#51

Description

After investigating the original issue, it looks like the Widget cannot be properly destroyed during its initialization process as it might lead to unexpected errors. If the Widget starts loading, we need to wait until it is loaded before making a decision if it should be destroyed or not.

This PR implements reinitialization scheduling which relies on LC_API.on_after_load for synchronous abut widget being initialized. Prevent from calling LiveChatWidget.destroy() while the widget is loading and track the last desired state instead of conditionally destroying it after it is fully loaded.

@walaszczykm walaszczykm linked an issue Aug 12, 2022 that may be closed by this pull request
@walaszczykm walaszczykm added bug Something isn't working enhancement New feature or request labels Aug 12, 2022
@walaszczykm walaszczykm force-pushed the feature/reinitialization-scheduling branch 2 times, most recently from a84fff5 to 1a67a0c Compare September 5, 2022 12:54
@walaszczykm walaszczykm marked this pull request as ready for review September 5, 2022 14:40
@walaszczykm walaszczykm requested a review from a team as a code owner September 5, 2022 14:40
@walaszczykm walaszczykm force-pushed the feature/reinitialization-scheduling branch from 1a67a0c to d5b070d Compare September 5, 2022 14:59
Copy link

@ZiggyKraus ZiggyKraus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it looks fine! 👏

@walaszczykm walaszczykm merged commit 096da2c into master Sep 5, 2022
@walaszczykm walaszczykm deleted the feature/reinitialization-scheduling branch September 5, 2022 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type error if the Widget is creating-destroying quick enough
2 participants