show onboarding from secondary connect buttons

This commit is contained in:
saml33 2023-10-30 09:56:49 +11:00
parent 25eb665cc1
commit e2abfb5bec
1 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ import Button from './Button'
import { useWallet } from '@solana/wallet-adapter-react'
import useLocalStorageState from 'hooks/useLocalStorageState'
import { WalletName, WalletReadyState } from '@solana/wallet-adapter-base'
import { AUTO_CONNECT_WALLET, LAST_WALLET_NAME } from 'utils/constants'
import { IS_ONBOARDED_KEY, LAST_WALLET_NAME } from 'utils/constants'
import { notify } from 'utils/notifications'
import { LinkIcon } from '@heroicons/react/20/solid'
import mangoStore from '@store/mangoStore'
@ -24,10 +24,10 @@ const SecondaryConnectButton = ({
LAST_WALLET_NAME,
'',
)
const [autoConnect] = useLocalStorageState(AUTO_CONNECT_WALLET, true)
const [isOnboarded] = useLocalStorageState(IS_ONBOARDED_KEY)
const handleConnect = useCallback(() => {
if (!autoConnect) {
if (!isOnboarded) {
set((s) => {
s.showUserSetup = true
})
@ -48,7 +48,7 @@ const SecondaryConnectButton = ({
})
}
}
}, [autoConnect, lastWalletName, select, wallets])
}, [isOnboarded, lastWalletName, select, wallets])
return (
<Button