From 960378b213f78532991808826f7a695dd7b2fe4e Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Tue, 15 Mar 2022 19:31:45 -0800 Subject: [PATCH] hotfix: run fetch client side only --- frontend/composables/api/use-app-info.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/composables/api/use-app-info.ts b/frontend/composables/api/use-app-info.ts index e3434b940..954467535 100644 --- a/frontend/composables/api/use-app-info.ts +++ b/frontend/composables/api/use-app-info.ts @@ -1,11 +1,13 @@ -import { Ref, useAsync } from "@nuxtjs/composition-api"; -import { useAsyncKey } from "../use-utils"; +import { onMounted, ref, Ref } from "@nuxtjs/composition-api"; import { AppInfo } from "~/types/api-types/admin"; export function useAppInfo(): Ref { - return useAsync(async () => { - // We use fetch here to reduce need for additional dependencies + const appInfo = ref(null); + + onMounted(async () => { const data = await fetch("/api/app/about").then((res) => res.json()); - return data as AppInfo; - }, useAsyncKey()); + appInfo.value = data as AppInfo; + }); + + return appInfo; }