improve wallet connect

This commit is contained in:
tjs 2023-07-22 16:43:36 -04:00
parent 2ee8b708ee
commit c595bfe8bd
2 changed files with 5 additions and 7 deletions

View File

@ -16,8 +16,7 @@ export default function ConnectWalletButton({
handleShowSetup: () => void
}) {
const { t } = useTranslation('common')
const { wallet, wallets, select, connected, autoConnect, connect } =
useWallet()
const { wallet, wallets, select, connected, connect } = useWallet()
const [isOnboarded] = useLocalStorageState(IS_ONBOARDED_KEY)
const mangoAccountLoading = mangoStore((s) => s.mangoAccount.initialLoad)
const [lastWalletName] = useLocalStorageState<WalletName | null>(
@ -44,11 +43,10 @@ export default function ConnectWalletButton({
<div className="flex">
<button
onClick={() => {
if (autoConnect) {
select(lastWalletName)
if (wallet) {
connect()
} else {
select(lastWalletName)
connect()
}
}}
className="relative flex h-16 bg-th-bkg-3 py-2 text-white before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-th-bkg-4 before:to-transparent before:opacity-0 hover:overflow-hidden hover:before:-translate-x-full hover:before:animate-[shimmer_0.75s_normal] hover:before:opacity-100 focus-visible:bg-th-bkg-4 disabled:cursor-wait disabled:opacity-25"

View File

@ -88,8 +88,8 @@ function MyApp({ Component, pageProps }: AppProps) {
}
} else {
notify({
title: `${adapter?.name} ${error.error}`,
type: 'error',
title: `${adapter?.name} ${error.error?.message || 'Error'}`,
type: 'info',
})
}
}, [])