Skip to content

Commit 7114d5d

Browse files
authored
fix docs main ci (#345)
1 parent 2136a90 commit 7114d5d

4 files changed

Lines changed: 25 additions & 9 deletions

File tree

e2e/virtual-addresses.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ test('virtual addresses guide signs in and starts master registration', async ({
3131
await expect(
3232
page.getByRole('heading', { name: 'Use virtual addresses for deposits' }),
3333
).toBeVisible()
34+
await page.getByRole('tab', { name: 'Real registration' }).click()
3435
await expect(page.getByRole('button', { name: 'Sign out' }).first()).toBeVisible({
3536
timeout: 30000,
3637
})

src/components/guides/Demo.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ export function ReceiptHash({ hash }: { hash: string }) {
104104
export function ExplorerAccountLink({
105105
address,
106106
inline = false,
107-
}: { address: string; inline?: boolean }) {
107+
}: {
108+
address: string
109+
inline?: boolean
110+
}) {
108111
const { trackExternalLinkClick } = usePostHogTracking()
109112
const url = `${getExplorerHost()}/address/${address}`
110113

@@ -459,7 +462,7 @@ export function Step(
459462
<div className="flex items-center gap-3.5">
460463
<div
461464
className={cx(
462-
'shrink-0 flex size-7 items-center justify-center rounded-full text-center text-[13px] text-black tabular-nums opacity-40 group-data-[completed=true]:opacity-100 dark:text-white',
465+
'flex size-7 shrink-0 items-center justify-center rounded-full text-center text-[13px] text-black tabular-nums opacity-40 group-data-[completed=true]:opacity-100 dark:text-white',
463466
completed ? 'bg-green3' : 'bg-gray4',
464467
)}
465468
>
@@ -605,6 +608,7 @@ export function Button(
605608
const Element = render ? (p: typeof props) => React.cloneElement(render, p) : 'button'
606609
return (
607610
<Element
611+
disabled={disabled ? true : undefined}
608612
className={buttonClassName({
609613
className,
610614
disabled,

src/components/guides/VirtualAddressesLiveDemo.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,9 @@ export function VirtualAddressesLiveDemo() {
655655
<span className="break-all font-mono text-[12px] text-primary">
656656
{registration.virtualAddress}
657657
</span>
658-
{hasExplorerLink && <ExplorerAccountLink address={registration.virtualAddress} inline />}
658+
{hasExplorerLink && (
659+
<ExplorerAccountLink address={registration.virtualAddress} inline />
660+
)}
659661
</span>
660662
</div>
661663
<div>
@@ -694,9 +696,8 @@ export function VirtualAddressesLiveDemo() {
694696
<div className="space-y-1">
695697
<span className="text-primary">Transfer events in this receipt</span>
696698
<div>
697-
Treat the <span className="font-mono text-primary">sender → virtual</span>{' '}
698-
and <span className="font-mono text-primary">virtual → master</span> pair as
699-
one
699+
Treat the <span className="font-mono text-primary">sender → virtual</span> and{' '}
700+
<span className="font-mono text-primary">virtual → master</span> pair as one
700701
logical deposit to the registered wallet. Other transfer logs in the receipt,
701702
like fees, are separate.
702703
</div>

src/lib/useRootWebAuthnAccount.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ type RootWebAuthnAccountProvider = {
1717
request: (args: { method: 'eth_accounts' }) => Promise<readonly `0x${string}`[]>
1818
}
1919

20+
const rootWebAuthnAccountTimeoutMs = 30_000
21+
2022
export function useRootWebAuthnAccount() {
2123
const { address, connector } = useConnection()
2224

@@ -29,7 +31,11 @@ export function useRootWebAuthnAccount() {
2931

3032
const provider = await connector.getProvider()
3133
if (isRootWebAuthnAccountProvider(provider)) {
32-
await waitForProviderAccount(provider, address as `0x${string}`)
34+
await waitForProviderAccount(
35+
provider,
36+
address as `0x${string}`,
37+
rootWebAuthnAccountTimeoutMs,
38+
)
3339

3440
return provider.getAccount({
3541
accessKey: false,
@@ -38,12 +44,16 @@ export function useRootWebAuthnAccount() {
3844
})
3945
}
4046

41-
const credential = await waitForStoredCredential(address as `0x${string}`)
47+
const credential = await waitForStoredCredential(
48+
address as `0x${string}`,
49+
rootWebAuthnAccountTimeoutMs,
50+
)
4251
return accountFromCredential(credential)
4352
},
4453
refetchOnReconnect: false,
4554
refetchOnWindowFocus: false,
46-
retry: false,
55+
retry: 2,
56+
retryDelay: 500,
4757
staleTime: Number.POSITIVE_INFINITY,
4858
})
4959
}

0 commit comments

Comments
 (0)