From eaa7045ad213f879fc42e97eef6ae49413092521 Mon Sep 17 00:00:00 2001 From: Bernardo Simonassi Date: Sat, 23 Sep 2023 14:33:17 -0300 Subject: [PATCH] fix: session issues and lessons navigation --- apps/app/components/molecules/SearchModal.vue | 17 +- apps/app/components/molecules/TopBar.vue | 13 +- .../app/components/organisms/DefaultAside.vue | 6 +- apps/app/composables/useCookieFetch.ts | 10 + apps/app/layouts/default.vue | 1 + apps/app/middleware/session.global.ts | 18 +- apps/app/modules/eslint-globals.ts | 2 +- apps/app/package.json | 2 +- apps/app/pages/code.vue | 3 +- apps/app/pages/sign-in.vue | 2 +- apps/app/pages/sign-up.vue | 2 +- apps/app/stores/clerk/session.ts | 13 +- apps/app/stores/clerk/user.ts | 3 +- pnpm-lock.yaml | 172 +++++++++++++----- 14 files changed, 191 insertions(+), 73 deletions(-) create mode 100644 apps/app/composables/useCookieFetch.ts diff --git a/apps/app/components/molecules/SearchModal.vue b/apps/app/components/molecules/SearchModal.vue index af3ad69..65bda54 100644 --- a/apps/app/components/molecules/SearchModal.vue +++ b/apps/app/components/molecules/SearchModal.vue @@ -1,5 +1,6 @@ diff --git a/apps/app/components/organisms/DefaultAside.vue b/apps/app/components/organisms/DefaultAside.vue index a310505..c81d4d4 100644 --- a/apps/app/components/organisms/DefaultAside.vue +++ b/apps/app/components/organisms/DefaultAside.vue @@ -7,7 +7,7 @@ const queryBuilder = computed(() => { return queryContent(`/${route.params?.slug ? route.params.slug[0] : ""}`); }); -const { data: navigation } = await useAsyncData( +const { data: navigation, refresh } = await useAsyncData( route.params?.slug ? route.params.slug[0] : "navigation", () => fetchContentNavigation(queryBuilder.value), { @@ -18,6 +18,10 @@ const { data: navigation } = await useAsyncData( const isLesson = computed(() => { return !!route.meta?.lesson; }); + +watch(isLesson, async () => { + refresh(); +});