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

fix: ID-1174 Passport - delay preload until window ready #1111

Merged
merged 9 commits into from
Nov 5, 2023

Conversation

haydenfowler
Copy link
Contributor

@haydenfowler haydenfowler commented Nov 2, 2023

Summary

This PR resolves an issue where calling the Passport constructor before React had finished initialising (e.g. calling the constructor outside of a component) would result in subsequent interactions with the Magic SDK to fail. This would happen because the Magic iFrame would be appended to the DOM, but cleared out by shortly after when React initialises.

The fix is to delay the call to the preload function until the window / document is ready.

Fixed

  • Passport: Added a safeguard to prevent wallet interactions hanging indefinitely when the Passport constructor was called before React had initialised.

Before submitting the PR, please consider the following:

  • Prefix your PR title with feat: , fix: , chore: , docs:, or refactor:.

@haydenfowler haydenfowler requested a review from a team as a code owner November 2, 2023 00:27
@haydenfowler haydenfowler changed the title fix: ID-1174 passport lazy preload fix: ID-1174 Passport - delay preload until window ready Nov 2, 2023
@haydenfowler haydenfowler enabled auto-merge (squash) November 5, 2023 23:13
@haydenfowler haydenfowler merged commit 00b319f into main Nov 5, 2023
6 checks passed
@haydenfowler haydenfowler deleted the feature/ID-1174-passport-lazy-preload branch November 5, 2023 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants