@@ -38,6 +38,13 @@ async function checkAvailability() {
3838 }
3939}
4040
41+ function openConnectorModal() {
42+ const connectorModal = document .querySelector <HTMLDialogElement >(' #connector-modal' )
43+ if (connectorModal ) {
44+ connectorModal .showModal ()
45+ }
46+ }
47+
4148async function handleClaim() {
4249 if (! checkResult .value ?.available || ! isConnected .value ) return
4350
@@ -72,14 +79,14 @@ async function handleClaim() {
7279 if (completedOp .result ?.requiresOtp ) {
7380 // OTP is needed - open connector panel to handle it
7481 open .value = false
75- connectorModalOpen . value = true
82+ openConnectorModal ()
7683 } else {
7784 publishError .value = completedOp .result ?.stderr || ' Failed to publish package'
7885 }
7986 } else {
8087 // Still pending/approved/running - open connector panel to show progress
8188 open .value = false
82- connectorModalOpen . value = true
89+ openConnectorModal ()
8390 }
8491 } catch (err ) {
8592 publishError .value = err instanceof Error ? err .message : $t (' claim.modal.failed_to_claim' )
@@ -124,8 +131,6 @@ const previewPackageJson = computed(() => {
124131 ... (access && { publishConfig: { access } }),
125132 }
126133})
127-
128- const connectorModalOpen = shallowRef (false )
129134 </script >
130135
131136<template >
@@ -351,7 +356,7 @@ const connectorModalOpen = shallowRef(false)
351356 <button
352357 type =" button"
353358 class =" w-full px-4 py-2 font-mono text-sm text-bg bg-fg rounded-md transition-colors duration-200 hover:bg-fg/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50"
354- @click =" connectorModalOpen = true "
359+ @click =" openConnectorModal "
355360 >
356361 {{ $t('claim.modal.connect_button') }}
357362 </button >
@@ -420,7 +425,4 @@ const connectorModalOpen = shallowRef(false)
420425 </div >
421426 </Transition >
422427 </Teleport >
423-
424- <!-- Connector modal -->
425- <ConnectorModal v-model:open =" connectorModalOpen" />
426428</template >
0 commit comments