Skip to content

Commit b6e0916

Browse files
committed
fix
1 parent b583acd commit b6e0916

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

src/auth/context/web3Auth/authProvider.tsx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { AuthContextProvider } from './authContext';
99
import { web3AuthConnectorFactory } from "./config/web3AuthSettings";
1010
import { polygonAmoy } from "wagmi/chains";
1111

12+
import { getConnectorClient } from '@wagmi/core'
1213
/**
1314
* AuthProvider is a higher-order component that wraps the application with necessary providers
1415
* for state management, wallet connection, and Lens Protocol integration.
@@ -17,26 +18,50 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
1718

1819
const queryClient = new QueryClient();
1920
const [web3Auth, web3AuthConnector] = web3AuthConnectorFactory()
20-
21+
2122
const wagmiConfig = createConfig({
2223
syncConnectedChain: true,
2324
chains: [polygonAmoy],
2425
connectors: [web3AuthConnector],
25-
transports: { [polygonAmoy.id]: http(), }
26+
transports: { [polygonAmoy.id]: http() }
2627
})
2728

2829
const lensConfig: LensConfig = {
2930
environment: development,
3031
bindings: bindings(wagmiConfig),
32+
debug: true,
33+
storage: localStorage,
34+
logger: {
35+
info(message: string, data?: unknown) {
36+
console.log(message)
37+
console.log(data)
38+
},
39+
warn(message: string, data?: unknown){
40+
console.log(message)
41+
console.log(data)
42+
},
43+
error(error: Error, message?: string, data?: unknown){
44+
console.log(message)
45+
console.log(data)
46+
},
47+
fatal(error: Error, message?: string, data?: unknown){
48+
console.log(message)
49+
console.log(data)
50+
}
51+
}
3152
};
3253

54+
(async ()=>(
55+
console.log(await getConnectorClient(wagmiConfig))
56+
))()
57+
3358
return (
34-
<QueryClientProvider client={queryClient}>
35-
<WagmiProvider config={wagmiConfig}>
59+
<WagmiProvider config={wagmiConfig}>
60+
<QueryClientProvider client={queryClient}>
3661
<LensProvider config={lensConfig}>
3762
<AuthContextProvider web3Auth={web3Auth}>{children}</AuthContextProvider>
3863
</LensProvider>
39-
</WagmiProvider>
40-
</QueryClientProvider>
64+
</QueryClientProvider>
65+
</WagmiProvider>
4166
);
4267
};

src/components/loginModal/profileSelectView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// REACT IMPORTS
2-
import React, { useCallback, useEffect, useState } from 'react';
2+
import React, { useEffect, useState } from 'react';
33

44
// MUI IMPORTS
55
import {
@@ -16,6 +16,7 @@ import { UserItem } from '../user-item';
1616
import { Profile, ProfileSession, useLogin, useSession } from '@lens-protocol/react-web';
1717
// @ts-ignore
1818
import { ReadResult } from '@lens-protocol/react/dist/declarations/src/helpers/reads';
19+
1920
import { useDispatch } from 'react-redux';
2021
import Snackbar from '@mui/material/Snackbar';
2122
import Alert from '@mui/material/Alert';
@@ -50,7 +51,7 @@ export const ProfileSelectView: React.FC<ProfileSelectionProps> = ({
5051
if (data !== undefined && !error) dispatch(setAuthLoading({ isAuthLoading: false }));
5152
if (error) setErrorMessage(error.message);
5253
}, [data, error])
53-
54+
5455
const login = async (profile?: Profile) => {
5556

5657
if (!profile) {

0 commit comments

Comments
 (0)