Skip to content

Commit

Permalink
Clear login error notice on accountsChanged event
Browse files Browse the repository at this point in the history
  • Loading branch information
John Halbert committed Apr 25, 2023
1 parent 81c0da1 commit 80a8f06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/web3/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ interface Props {
export const Login: React.FC<Props> = ({ web3address, onAddressSelected }) => {
const [notice, setNotice] = useState<JSX.Element | undefined>();

useEffect(() => {
window.ethereum?.on("accountsChanged", () => setNotice(undefined));
}, []);

useEffect(() => {
if (!web3address) {
setNotice(<span>Requesting wallet access...</span>);
Expand Down

0 comments on commit 80a8f06

Please sign in to comment.