is there a way to call a function when the user switches there metamask wallet to another wallet.
Im trying to achieve the same thing as 1Inch where if you switch wallets the data on the page is automatically reloaded.
I have found this in the Moralis documentation
Moralis.onAccountsChanged(async function (accounts) {
// DO SOMETHING
});
But this function is only called if the user disconnects or connects their wallet and is not called on a simple switch.