Skip to content

Commit 6cb2277

Browse files
authored
fix(clerk-js): Allow modal closing after a new connected account (#6433)
1 parent de56751 commit 6cb2277

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/poor-chicken-occur.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Added proper type checking before using the in operator to prevent errors when modal state contains non-object values

packages/clerk-js/src/ui/Components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ const Components = (props: ComponentsProps) => {
326326
setState(s => {
327327
function handleCloseModalForExperimentalUserVerification() {
328328
const modal = s[`${name}Modal`] || {};
329-
if ('afterVerificationCancelled' in modal && notify) {
329+
if (modal && typeof modal === 'object' && 'afterVerificationCancelled' in modal && notify) {
330330
modal.afterVerificationCancelled?.();
331331
}
332332
}

0 commit comments

Comments
 (0)