mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-08-22 00:27:13 -05:00
fix: account info updates on route update
This commit is contained in:
@@ -29,11 +29,12 @@ interface InfoCCResponse {
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const accountInfo = await useFetch<InfoCCResponse>('/api/account/info'); // TODO: does doing this cause too many requests? can't depend on route due to hydration issues
|
||||
|
||||
const accountInfo = await useFetch<InfoCCResponse>('/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('/');
|
||||
|
||||
Reference in New Issue
Block a user