perf(client-side): stop providing an injectable user object

nuxt-auth takes care of this with `useAuth`; redundant
This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2023-10-10 22:02:42 -04:00
parent 98d93f9178
commit b0e949df3b
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

20
app.vue
View File

@ -1,10 +1,15 @@
<script lang="ts" setup> <script lang="ts" setup>
import { theme } from "ant-design-vue"; import { theme } from "ant-design-vue";
import { IUser } from "./models/user";
const dop = useAuth().data?.value as any; const { getSession, signIn } = useAuth();
await getSession({ force: true });
const { data } = await useAuth();
const dop = data?.value as any;
let darkBool = dop?.user?.profile?.nightMode || false; let darkBool = dop?.user?.profile?.nightMode || false;
provide("user", ref(dop?.user || null)); // provide("user", ref(dop?.user || null));
provide("dark", darkBool); provide("dark", darkBool);
useHead({ useHead({
bodyAttrs: { bodyAttrs: {
@ -30,7 +35,7 @@
<a-config-provider <a-config-provider
:theme="{ :theme="{
token: { token: {
colorPrimary: '#ff2883', colorPrimary: '#f14668',
colorSuccess: '#2be396', colorSuccess: '#2be396',
colorWarning: '#face14', colorWarning: '#face14',
colorInfo: '#15c6e3', colorInfo: '#15c6e3',
@ -40,7 +45,12 @@
}" }"
> >
<NuxtLayout> <NuxtLayout>
<NuxtPage /> <NuxtPage v-if="$loaded" />
<div v-else>
<a-skeleton-title />
<a-skeleton />
<a-skeleton />
</div>
<!-- <NuxtWelcome /> --> <!-- <NuxtWelcome /> -->
</NuxtLayout> </NuxtLayout>
</a-config-provider> </a-config-provider>