Set userPairingId on connect
This commit is contained in:
parent
90b2ed5e6e
commit
74ae167e3c
12
src/App.tsx
12
src/App.tsx
@ -61,6 +61,18 @@ function App() {
|
||||
}
|
||||
}, [isConnected, iframeUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isConnected && userPairingId === null) {
|
||||
const messageBus = MessageBus.getInstance(iframeUrl);
|
||||
messageBus.isReady().then(() => {
|
||||
messageBus.getUserPairingId().then((userPairingId: string) => {
|
||||
UserStore.getInstance().pair(userPairingId);
|
||||
setUserPairingId(UserStore.getInstance().getUserPairingId());
|
||||
})
|
||||
});
|
||||
}
|
||||
}, [isConnected, userPairingId]);
|
||||
|
||||
// Gestionnaire pour afficher la modale de connexion
|
||||
const handleLogin = useCallback(() => {
|
||||
// Afficher la modale de connexion
|
||||
|
Loading…
x
Reference in New Issue
Block a user