Skip to content

Commit 0c229f8

Browse files
committed
fixes rehydration
1 parent ef31908 commit 0c229f8

File tree

1 file changed

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

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import "./App.css";
44

55
// IMP START - Quick Start
6-
import { authConnector, CustomChainConfig, getEvmChainConfig, IProvider, Web3Auth, WEB3AUTH_NETWORK } from "@web3auth/modal";
6+
import { authConnector, CONNECTOR_EVENTS, CustomChainConfig, getEvmChainConfig, IProvider, Web3Auth, WEB3AUTH_NETWORK } from "@web3auth/modal";
77
// IMP END - Quick Start
88
import { useEffect, useState } from "react";
99

@@ -46,9 +46,13 @@ function App() {
4646
// IMP END - SDK Initialization
4747
setProvider(web3auth.provider);
4848

49-
if (web3auth.connected) {
49+
web3auth.on(CONNECTOR_EVENTS.CONNECTED, () => {
5050
setLoggedIn(true);
51-
}
51+
});
52+
53+
// if (web3auth.connected) {
54+
// setLoggedIn(true);
55+
// }
5256
} catch (error) {
5357
console.error(error);
5458
}

0 commit comments

Comments
 (0)