Changed the way the sidebar works

This commit is contained in:
Alexis
2025-03-13 18:25:04 +01:00
parent fdb77a20f3
commit f0e3fc2167
10 changed files with 117 additions and 34 deletions

View File

@@ -6,7 +6,7 @@ const supabase = useSupabaseClient()
const user = useSupabaseUser()
definePageMeta({
middleware: ["auth-guard"]
middleware: ["auth-guard", "reset-menu"]
})
const { data: worlds } = await useLazyFetch<{ data: World[] }>("/api/worlds/query", { query: { gmId: user?.value!.id } })
@@ -31,7 +31,6 @@ function hideCreateDialog() {
/** Active world channel */
let worldChannel: RealtimeChannel
/** Handles world insertion realtime events */
function handleInsertedWorld(newWorld: WorldChannelPayload) {
if (!worlds.value?.data) return
@@ -121,10 +120,12 @@ function hideEditModal() {
<template>
<main class="p-8">
<Head>
<Title>{{ $t("entity.world.namePlural") }}</Title>
<Title>{{ $t("pages.profile.metaTitle") }}</Title>
</Head>
<Heading level="h1">{{ user?.user_metadata.full_name }}</Heading>
<Heading level="h1">
{{ $t("pages.profile.title", { user: user?.user_metadata.full_name }) }}
</Heading>
<section class="mt-4">
<Spacing size="lg">