Skip to content

Commit 57434f2

Browse files
committed
remove extra code from modal quick start
1 parent f21d35d commit 57434f2

File tree

1 file changed

+3
-23
lines changed
  • web-modal-sdk/quick-starts/react-modal-quick-start/src

1 file changed

+3
-23
lines changed

web-modal-sdk/quick-starts/react-modal-quick-start/src/App.tsx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ const web3auth = new Web3Auth({
2828
clientId,
2929
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
3030
chains,
31-
defaultChainId: chains[0].chainId,
3231
connectors: [authConnector({ connectorSettings: { buildEnv: "testing", redirectUrl: window.location.origin } })],
33-
// multiInjectedProviderDiscovery: true,
3432
});
3533
// IMP END - SDK Initialization
3634

@@ -42,25 +40,7 @@ function App() {
4240
const init = async () => {
4341
try {
4442
// IMP START - SDK Initialization
45-
await web3auth.initModal({
46-
modalConfig: {
47-
[WALLET_CONNECTORS.AUTH]: {
48-
label: "auth",
49-
loginMethods: {
50-
google: {
51-
name: "google login",
52-
showOnModal: true,
53-
authConnectionId: "w3a-google-demo",
54-
},
55-
facebook: {
56-
name: "facebook login",
57-
showOnModal: false,
58-
},
59-
},
60-
showOnModal: true,
61-
},
62-
},
63-
});
43+
await web3auth.initModal();
6444
// IMP END - SDK Initialization
6545
setProvider(web3auth.provider);
6646

@@ -84,9 +64,9 @@ function App() {
8464
const web3authProvider = await web3auth.connect();
8565
// IMP END - Login
8666
setProvider(web3authProvider);
87-
if (web3auth.connected) {
67+
web3auth.on(CONNECTOR_EVENTS.CONNECTED, () => {
8868
setLoggedIn(true);
89-
}
69+
});
9070
};
9171

9272
const getUserInfo = async () => {

0 commit comments

Comments
 (0)