force user initialisation - fixes #2

This commit is contained in:
Michael Dausmann
2023-04-07 23:28:13 +10:00
parent 59d9d0f684
commit b4b20e4260
5 changed files with 14 additions and 3 deletions

View File

@@ -10,6 +10,10 @@
const config = useRuntimeConfig();
const newAccountName = ref("");
onMounted(async () => {
await authStore.initUser();
});
watchEffect(async () => {
if (activeMembership.value) {
await accountStore.getActiveAccountMembers();

View File

@@ -11,6 +11,10 @@
const notesStore = useNotesStore();
const { notes } = storeToRefs(notesStore); // ensure the notes list is reactive
onMounted(async () => {
await authStore.initUser();
});
watchEffect(async () => {
if (activeMembership.value) {
await notesStore.fetchNotesForCurrentUser();

View File

@@ -5,6 +5,9 @@
const authStore = useAuthStore()
const { activeMembership } = storeToRefs(authStore);
onMounted(async () => {
await authStore.initUser();
});
</script>
<template>
<div>