Skip to content

Commit

Permalink
Use window.addEventListener("load") instead of window.onload for …
Browse files Browse the repository at this point in the history
…Discovery API (#1958)
  • Loading branch information
jribbink authored Sep 27, 2024
1 parent ba5fca5 commit e97e8d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-news-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/fcl-core": patch
---

Fix window.onload for discovery API
4 changes: 2 additions & 2 deletions packages/fcl-core/src/discovery/services/authn.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ const HANDLERS = {
if (document.readyState === "complete") {
fetchServicesFromDiscovery()
} else {
window.onload = async () => {
window.addEventListener("load", () => {
fetchServicesFromDiscovery()
}
})
}
},
[SERVICE_ACTOR_KEYS.UPDATE_RESULTS]: (ctx, _letter, data) => {
Expand Down

0 comments on commit e97e8d2

Please sign in to comment.