Skip to content

Commit

Permalink
fix(clerk-js): Only call ensureMounted() if necessary (#4876)
Browse files Browse the repository at this point in the history
  • Loading branch information
BRKalow authored Jan 14, 2025
1 parent e45d455 commit 43ba063
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-glasses-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Fixes an issue that caused Clerk's UI code to load even before components were rendered.
8 changes: 4 additions & 4 deletions packages/clerk-js/src/core/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2093,16 +2093,16 @@ export class Clerk implements ClerkInterface {
};

#handleKeylessPrompt = () => {
void this.#componentControls?.ensureMounted().then(controls => {
if (this.#options.__internal_claimKeylessApplicationUrl) {
if (this.#options.__internal_claimKeylessApplicationUrl) {
void this.#componentControls?.ensureMounted().then(controls => {
controls.updateProps({
options: {
__internal_claimKeylessApplicationUrl: this.#options.__internal_claimKeylessApplicationUrl,
__internal_copyInstanceKeysUrl: this.#options.__internal_copyInstanceKeysUrl,
},
});
}
});
});
}
};

#buildUrl = (
Expand Down

0 comments on commit 43ba063

Please sign in to comment.