add wallet reconnect logic to market page

This commit is contained in:
Tyler Shipe 2021-11-15 23:00:00 +00:00
parent 780ef281eb
commit e25d62eaa5
1 changed files with 8 additions and 0 deletions

View File

@ -32,6 +32,14 @@ const PerpMarket = () => {
const marketConfig = useMangoStore((s) => s.selectedMarket.config)
const router = useRouter()
useEffect(() => {
// @ts-ignore
if (window.solana) {
// @ts-ignore
window.solana.connect({ onlyIfTrusted: true })
}
}, [])
useEffect(() => {
const name = decodeURIComponent(router.asPath).split('name=')[1]