diff --git a/src/auth/context/web3Auth/authProvider.tsx b/src/auth/context/web3Auth/authProvider.tsx index 1b1e2cb78..fb64c8024 100644 --- a/src/auth/context/web3Auth/authProvider.tsx +++ b/src/auth/context/web3Auth/authProvider.tsx @@ -9,6 +9,7 @@ import { AuthContextProvider } from './authContext'; import { web3AuthConnectorFactory } from "./config/web3AuthSettings"; import { polygonAmoy } from "wagmi/chains"; +import { getConnectorClient } from '@wagmi/core' /** * AuthProvider is a higher-order component that wraps the application with necessary providers * for state management, wallet connection, and Lens Protocol integration. @@ -17,26 +18,50 @@ export const AuthProvider: React.FC = ({ children }) => { const queryClient = new QueryClient(); const [web3Auth, web3AuthConnector] = web3AuthConnectorFactory() - + const wagmiConfig = createConfig({ syncConnectedChain: true, chains: [polygonAmoy], connectors: [web3AuthConnector], - transports: { [polygonAmoy.id]: http(), } + transports: { [polygonAmoy.id]: http() } }) const lensConfig: LensConfig = { environment: development, bindings: bindings(wagmiConfig), + debug: true, + storage: localStorage, + logger: { + info(message: string, data?: unknown) { + console.log(message) + console.log(data) + }, + warn(message: string, data?: unknown){ + console.log(message) + console.log(data) + }, + error(error: Error, message?: string, data?: unknown){ + console.log(message) + console.log(data) + }, + fatal(error: Error, message?: string, data?: unknown){ + console.log(message) + console.log(data) + } + } }; + (async ()=>( + console.log(await getConnectorClient(wagmiConfig)) + ))() + return ( - - + + {children} - - + + ); }; diff --git a/src/components/loginModal/profileSelectView.tsx b/src/components/loginModal/profileSelectView.tsx index a173cd86c..8c64023e1 100644 --- a/src/components/loginModal/profileSelectView.tsx +++ b/src/components/loginModal/profileSelectView.tsx @@ -1,5 +1,5 @@ // REACT IMPORTS -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; // MUI IMPORTS import { @@ -16,6 +16,7 @@ import { UserItem } from '../user-item'; import { Profile, ProfileSession, useLogin, useSession } from '@lens-protocol/react-web'; // @ts-ignore import { ReadResult } from '@lens-protocol/react/dist/declarations/src/helpers/reads'; + import { useDispatch } from 'react-redux'; import Snackbar from '@mui/material/Snackbar'; import Alert from '@mui/material/Alert'; @@ -50,7 +51,7 @@ export const ProfileSelectView: React.FC = ({ if (data !== undefined && !error) dispatch(setAuthLoading({ isAuthLoading: false })); if (error) setErrorMessage(error.message); }, [data, error]) - + const login = async (profile?: Profile) => { if (!profile) {