Skip to content

Commit

Permalink
removed login animations and brought back success callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-Gordon committed Apr 11, 2024
1 parent 38e0481 commit e9c1d70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ export default function RootLayout({
<ZeroDevProvider projectId={process.env.NEXT_PUBLIC_ZERODEV_ID as string}>
<PrivyProvider
appId={'cltk97hyk016h7afh32g4363z'}
onSuccess={() => {
router.push('/home');
}}
config={{
appearance: {
theme: 'dark',
Expand Down
14 changes: 6 additions & 8 deletions src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@ const Page = () => {
});
}); */
useEffect(() => {
if (zeroDevReady && authenticated ) {
if (zeroDevReady && !authenticated ) {
console.log("authenticated", authenticated)
// set user address
console.log("address", user?.wallet?.address)
dispatch(setAddress(user?.wallet?.address as string));

// route home

setRouteHome(true);
setTimeout(() => {
router.push('/home');
}, 700)


}
}, [authenticated, zeroDevReady]);

Expand All @@ -68,7 +66,7 @@ const Page = () => {
return (
<>
<AnimatePresence>
{!routeHome && (

<motion.div

key={"login-page"}
Expand Down Expand Up @@ -102,7 +100,7 @@ const Page = () => {
<Link href={'/home'}>home</Link>
</div>
</motion.div>
)}

</AnimatePresence>
</>
);
Expand Down

0 comments on commit e9c1d70

Please sign in to comment.