From 2df8422df491d03ab35edd06bf1d92ff123e9783 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Sat, 17 Aug 2024 19:13:49 +0900 Subject: [PATCH] feat: redirect logged users to /home --- 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 } +);