dont auto connect when viewing accts

This commit is contained in:
tjs 2023-07-20 21:16:41 -04:00
parent 4f4ef23ec3
commit 28cb708dcd
1 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,7 @@ const metaDescription =
function MyApp({ Component, pageProps }: AppProps) {
const network = WalletAdapterNetwork.Mainnet
const endpoint = useMemo(() => clusterApiUrl(network), [network])
const router = useRouter()
const wallets = useMemo(
() => [
new PhantomWalletAdapter(),
@ -114,7 +115,11 @@ function MyApp({ Component, pageProps }: AppProps) {
<MangoProvider />
<QueryClientProvider client={queryClient}>
<ConnectionProvider endpoint={endpoint}>
<WalletProvider wallets={wallets} onError={onError} autoConnect>
<WalletProvider
wallets={wallets}
onError={onError}
autoConnect={router.asPath.includes('?address') ? false : true}
>
<ThemeProvider defaultTheme="Mango Classic" storageKey={THEME_KEY}>
<ViewportProvider>
<PageTitle />