File tree Expand file tree Collapse file tree
packages/clerk-js/src/ui/components/devPrompts/KeylessPrompt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,32 +253,27 @@ type ResolvedContent = {
253253export function getResolvedContent ( state : STATES , context : ResolvedContentContext ) : ResolvedContent {
254254 const content = CONTENT [ state ] ;
255255
256- // Resolve description (static or function-based)
257256 const description =
258257 typeof content . description === 'function'
259258 ? content . description ( { appName : context . appName , instanceUrl : context . instanceUrl } )
260259 : content . description ;
261260
262- // Resolve CTA based on kind
263- let cta : ResolvedContent [ 'cta' ] ;
264- if ( content . cta . kind === 'link' ) {
265- const linkCta = content . cta ;
266- cta = {
267- kind : 'link' ,
268- text : linkCta . text ,
269- href :
270- typeof linkCta . href === 'function'
271- ? linkCta . href ( { claimUrl : context . claimUrl , instanceUrl : context . instanceUrl } )
272- : linkCta . href ,
273- } ;
274- } else {
275- const actionCta = content . cta ;
276- cta = {
277- kind : 'action' ,
278- text : actionCta . text ,
279- onClick : ( ) => actionCta . onClick ( context . onDismiss ) ,
280- } ;
281- }
261+ const ctaItem = content . cta ;
262+ const cta : ResolvedContent [ 'cta' ] =
263+ ctaItem . kind === 'link'
264+ ? {
265+ kind : 'link' ,
266+ text : ctaItem . text ,
267+ href :
268+ typeof ctaItem . href === 'function'
269+ ? ctaItem . href ( { claimUrl : context . claimUrl , instanceUrl : context . instanceUrl } )
270+ : ctaItem . href ,
271+ }
272+ : {
273+ kind : 'action' ,
274+ text : ctaItem . text ,
275+ onClick : ( ) => ctaItem . onClick ( context . onDismiss ) ,
276+ } ;
282277
283278 return {
284279 state,
You can’t perform that action at this time.
0 commit comments