From 54c2cbebac1aee9be7999fa5b395c8327b4c904a Mon Sep 17 00:00:00 2001 From: Wan <495709+wa0x6e@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:17:59 +0900 Subject: [PATCH] feat: redirect logged users to /home (#640) --- apps/ui/src/views/Landing.vue | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/ui/src/views/Landing.vue b/apps/ui/src/views/Landing.vue index 27c72da5c..a90b46f38 100644 --- a/apps/ui/src/views/Landing.vue +++ b/apps/ui/src/views/Landing.vue @@ -20,10 +20,26 @@ const SOCIALS = [ icon: ICGithub } ]; + +const router = useRouter(); +const { web3, authInitiated } = useWeb3(); + +watch( + () => web3.value.account, + account => { + if (!account) return; + + router.push({ name: 'my-home' }); + }, + { immediate: true } +);