Skip to content

Commit

Permalink
ui: always hide web3 modal after login
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashshah committed Dec 15, 2023
1 parent ca4cdd4 commit 8e3bbf1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/AppLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const AppLogin = ({ toggleDarkMode }) => {
let observer: ResizeObserver | undefined;
try {
setAuthError(undefined);
var onboardModal = document.getElementById("onboard-container");
const onboardModal = document.getElementById("onboard-container");
const observer = new ResizeObserver(() => {
setModalHeight(onboardModal.offsetHeight);
setModalWidth(onboardModal.offsetWidth);
Expand Down Expand Up @@ -113,12 +113,18 @@ const AppLogin = ({ toggleDarkMode }) => {
setWalletAddress(walletAddress);
}

const hideOnboardModal = () => {
const onboardModal = document.getElementById("onboard-container");
onboardModal.style.display = 'none';
}

const initiateReadOnlyMode = () => {
if (walletAddress) {
const isWallet = ethers.utils.isAddress(walletAddress);
if (isWallet) {
setMode(ReadOnlyWalletMode.READ_ONLY_MODE)
setReadOnlyWallet(walletAddress);
hideOnboardModal();
}
}
}
Expand All @@ -127,6 +133,7 @@ const AppLogin = ({ toggleDarkMode }) => {
const guestModeAddress = '0x0000000000000000000000000000000000000000';
setMode(ReadOnlyWalletMode.GUEST_MODE);
setReadOnlyWallet(guestModeAddress);
hideOnboardModal();
}

const RenderGuestMode = () => {
Expand Down

0 comments on commit 8e3bbf1

Please sign in to comment.