diff --git a/server/app.vue b/server/app.vue index a64e44236..4f97bae33 100644 --- a/server/app.vue +++ b/server/app.vue @@ -31,6 +31,13 @@ const user = useUser(); const apiDetails = await $dropFetch("/api/v1"); const clientMode = isClientRequest(); +const favicon = apiDetails.mLogoObjectId + ? useObject(apiDetails.mLogoObjectId) + : "/favicon.ico"; +useHead({ + link: [{ rel: "icon", href: favicon, key: "favicon" }], +}); + const showExternalUrlWarning = ref(false); function checkExternalUrl() { if (!import.meta.client || clientMode) return; diff --git a/server/layouts/admin.vue b/server/layouts/admin.vue index 19087df2e..db3cd8a1a 100644 --- a/server/layouts/admin.vue +++ b/server/layouts/admin.vue @@ -270,12 +270,9 @@ router.afterEach(() => { }); const { - generalSettings: { serverName, mLogoObjectId }, + generalSettings: { serverName }, } = await $dropFetch("/api/v1/settings"); -const favicon = mLogoObjectId ? useObject(mLogoObjectId) : "/favicon.ico"; -useFavicon(favicon, { rel: "icon" }); - const applicationName = serverName || $t("drop.drop"); useHead({ diff --git a/server/layouts/default.vue b/server/layouts/default.vue index ca8b7cb77..f344fd474 100644 --- a/server/layouts/default.vue +++ b/server/layouts/default.vue @@ -34,7 +34,4 @@ useHead({ return title ? t("titleTemplate", [title]) : t("title"); }, }); -const { mLogoObjectId } = await $dropFetch("/api/v1"); -const favicon = mLogoObjectId ? useObject(mLogoObjectId) : "/favicon.ico"; -useFavicon(favicon, { rel: "icon" }); diff --git a/server/nuxt.config.ts b/server/nuxt.config.ts index 0e06dcff0..8699827dd 100644 --- a/server/nuxt.config.ts +++ b/server/nuxt.config.ts @@ -90,12 +90,6 @@ export default defineNuxtConfig({ dropVersion: dropVersion, }, - app: { - head: { - link: [{ rel: "icon", href: "/favicon.ico" }], - }, - }, - routeRules: { "/api/**": { cors: true }, diff --git a/server/pages/store/[id]/index.vue b/server/pages/store/[id]/index.vue index 3693aad03..e09e5e05d 100644 --- a/server/pages/store/[id]/index.vue +++ b/server/pages/store/[id]/index.vue @@ -310,7 +310,7 @@ const ratingArray = Array(5) useHead({ title: game.mName, - // link: [{ rel: "icon", href: useObject(game.mIconObjectId) }], // Favicon doesn't get reset when we navigate off + link: [{ rel: "icon", href: useObject(game.mIconObjectId), key: "favicon" }], }); diff --git a/server/pages/store/c/[id]/index.vue b/server/pages/store/c/[id]/index.vue index b5dfd5490..2570b80c9 100644 --- a/server/pages/store/c/[id]/index.vue +++ b/server/pages/store/c/[id]/index.vue @@ -60,6 +60,8 @@ const { company } = await $dropFetch(`/api/v1/companies/${companyId}`); useHead({ title: company.mName, - link: [{ rel: "icon", href: useObject(company.mLogoObjectId) }], + link: [ + { rel: "icon", href: useObject(company.mLogoObjectId), key: "favicon" }, + ], });