From 0126d42762582547b09c3c2862a5edb74954af54 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Thu, 13 Mar 2025 22:11:19 +0100 Subject: [PATCH] Fixed data loading timing issue --- pages/my/calendars/[id].vue | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/pages/my/calendars/[id].vue b/pages/my/calendars/[id].vue index 9d76305..82cea2b 100644 --- a/pages/my/calendars/[id].vue +++ b/pages/my/calendars/[id].vue @@ -45,19 +45,24 @@ const isLoading = computed(() => calendarStatus.value === "pending" || categorie const { t } = useI18n() const { setCurrentMenu } = useUiStore() -setCurrentMenu([ - { - tooltip: t("entity.world.backToMy"), - to: "/my", - phIcon: "universe", - phIconWeight: "regular" - }, - { - tooltip: t("entity.world.backToSingle", { world: calendar.value?.data.world?.name }), - to: `/my/worlds/${calendar.value?.data.world?.id}`, - phIcon: "world" - }, -]) +// Set menu once we have the calendar data +watch(calendar, (n) => { + if (n?.data) { + setCurrentMenu([ + { + tooltip: t("entity.world.backToMy"), + to: "/my", + phIcon: "universe", + phIconWeight: "regular" + }, + { + tooltip: t("entity.world.backToSingle", { world: calendar.value?.data.world?.name }), + to: `/my/worlds/${calendar.value?.data.world?.id}`, + phIcon: "world" + }, + ]) + } +}, { immediate: true })