When user switch their account onAccountChanged
event triggers multiple times. Is there any way to solve this issue?
useEffect(() => {
var unsubscribe = null;
if (isAuthenticated && isWeb3Enabled) {
unsubscribe = Moralis.onAccountChanged(async (accounts) => {
console.log("onAccountChangedTriggered")
});
}
return () => {
if (unsubscribe) unsubscribe();
}; }, [isAuthenticated, isWeb3Enabled]);