Always await useAccountSession

If this is not done the session is not properly loaded during server
side rendering, making it possible for missmatch and bugs to happen.
This commit is contained in:
Hornwitser 2025-05-23 21:33:48 +02:00
parent 7f3029aee8
commit f2ab306338
2 changed files with 2 additions and 3 deletions

View file

@ -32,8 +32,7 @@ definePageMeta({
middleware: ["authenticated"],
});
const { data: session } = useAccountSession();
const { refresh: sessionRefresh } = useAccountSession();
const { data: session, refresh: sessionRefresh } = await useAccountSession();
const timezone = ref(session.value?.account.timezone ?? "");

View file

@ -30,7 +30,7 @@
</template>
<script lang="ts" setup>
const { data: session, refresh: sessionRefresh } = useAccountSession();
const { data: session, refresh: sessionRefresh } = await useAccountSession();
const { getSubscription, subscribe } = usePushNotification();
const name = ref("");