var account = web3.eth.accounts[0]; var accountInterval = setInterval(function() { if (web3.eth.accounts[0] !== account) { account = web3.eth.accounts[0]; updateInterface(); } }, 100);