Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(solana): injected connectors not detected #2656

Merged
merged 6 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/laboratory/tests/metamask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ synpressTest('should be connected as expected', async ({ page, metamask }) => {
await metamask.connectToDapp()
await modalValidator.expectConnected()
})

synpressTest('should show injected connectors on Solana as expected', async ({ page }) => {
await page.goto(`/library/solana`)
await page.getByTestId('connect-button').click()
const connectMetaMaskButton = page.getByTestId('wallet-selector-MetaMask')
await expect(connectMetaMaskButton).toBeVisible()
})
2 changes: 2 additions & 0 deletions packages/solana/src/utils/wallet-standard/watchStandard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export function watchStandard(callback: (arg: StandardWalletAdapter[]) => void)
})
]

callback(standardAdapters)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While setting the event listeners, this allow us to trigger the callback with initial data of available wallets.

is this a default?
Not sure what you mean, but the Wallet Standard don't have this or idk why they don't trigger at once if MM is disabled. Asked here


return () => listeners.forEach(off => off())
}

Expand Down
Loading