Skip to content

Commit

Permalink
Timeout fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Feb 28, 2023
1 parent 48915ee commit 0b33045
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/components/masa-interface/pages/connected/connected.tsx
Expand Up @@ -4,14 +4,19 @@ import { MasaLoading } from '../../../masa-loading';
import { Spinner } from '../../../spinner';

export const InterfaceConnected = (): JSX.Element => {
const { closeModal, isLoading } = useMasa();
const { closeModal, isLoading, isModalOpen } = useMasa();

useEffect(() => {
if (!isLoading) {
setTimeout(() => {
let timeout;
if (isModalOpen && !isLoading) {
timeout = setTimeout(() => {
closeModal?.();
}, 3000);
}

return () => {
clearTimeout(timeout);
};
}, [isLoading, closeModal]);

if (isLoading) return <MasaLoading />;
Expand Down
Expand Up @@ -122,7 +122,7 @@ export const InterfaceCreateSoulname = (): JSX.Element => {
justifyContent: 'flex-start',
}}
>
<div style={{ textAlign: 'center', marginTop: 64 }}>
<div style={{ textAlign: 'center', marginTop: 32 }}>
<h1 className="title">Minting your domain</h1>
<h1 className="title">
{soulname}
Expand Down

0 comments on commit 0b33045

Please sign in to comment.