From 6f9bc946b3f7318e85e625c9fc007c08d3c0a3a0 Mon Sep 17 00:00:00 2001 From: niko <57009359+hauntii@users.noreply.github.com> Date: Mon, 26 May 2025 06:24:04 -0400 Subject: [PATCH] fix: account info updates on route update --- src/components/Navbar/Navbar.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Navbar/Navbar.vue b/src/components/Navbar/Navbar.vue index 91f1b0d..28cd1c1 100644 --- a/src/components/Navbar/Navbar.vue +++ b/src/components/Navbar/Navbar.vue @@ -29,11 +29,12 @@ interface InfoCCResponse { } const route = useRoute(); -const accountInfo = await useFetch('/api/account/info'); // TODO: does doing this cause too many requests? can't depend on route due to hydration issues + +const accountInfo = await useFetch('/api/account/info', { watch: [() => route.path] }); // TODO: does doing this cause too many requests? async function logoutClick() { await $fetch('/api/account/logout'); - accountInfo.clear(); + accountInfo.clear(); // manually clear since redirect is only going to happen on the account page if (route.path == '/account') { navigateTo('/');