You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case where a user has multiples wallet registered in the app, if the UI invokes a function that triggers a wallet choice the webview will open as many times as the users invokes the said function.
Example: In the case where I'm trying to retrieve the user pkh in a react's useEffect function, the modal open's twice in developpement mode as the useEffect are called twice to test the cleanup function (see docs).
const[currentWalletAddress,setCurrentWalletAddress]=useState<string|undefined>()const[isWalletConnected,setIsWalletConnected]=useState<boolean>(false)constauWalletRef=useRef<AUWalletProviderClass|null>(null)consttezosRef=useRef<TezosToolkit|null>(null)useEffect(()=>{if(typeofwindow!=='undefined'){tezosRef.current=newTezosToolkit(process.env.NEXT_PUBLIC_APP_RPC_ADDRESSasstring)auWalletRef.current=newAUWalletProvider({name: walletOptions.name,url: walletOptions.url,icons: [walletOptions.iconUrl],})tezos.current.setProvider({wallet: auWalletRef.current})constwalletAddress=awaitauWalletRef.current?.getPKH()if(walletAddress){setCurrentWalletAddress(walletAddress)setIsWalletConnected(true)}return()=>{// Effect cleanup// is there a method to cancel the previous request ?}}},[])
The text was updated successfully, but these errors were encountered:
In the case where a user has multiples wallet registered in the app, if the UI invokes a function that triggers a wallet choice the webview will open as many times as the users invokes the said function.
Example: In the case where I'm trying to retrieve the user pkh in a react's useEffect function, the modal open's twice in developpement mode as the useEffect are called twice to test the cleanup function (see docs).
The text was updated successfully, but these errors were encountered: