Skip to content

Commit

Permalink
fix: pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw committed Sep 6, 2024
1 parent d94da7c commit 9336f6b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apps/nextjs/src/components/layout/search-engine-optimization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import { serverSettings } from "@homarr/db/schema/sqlite";
import type { defaultServerSettings } from "@homarr/server-settings";

export const SearchEngineOptimization = async () => {
const analyticSetting = await db.query.serverSettings.findFirst({
where: eq(serverSettings.settingKey, "analytics"),
const crawlingAndIndexingSetting = await db.query.serverSettings.findFirst({
where: eq(serverSettings.settingKey, "crawlingAndIndexing"),
});

if (!analyticSetting) {
if (!crawlingAndIndexingSetting) {
return null;
}

const value = SuperJSON.parse<(typeof defaultServerSettings)["crawlingAndIndexing"]>(analyticSetting.value);
const value = SuperJSON.parse<(typeof defaultServerSettings)["crawlingAndIndexing"]>(
crawlingAndIndexingSetting.value,
);

const robotsAttributes = [...(value.noIndex ? ["noindex"] : []), ...(value.noIndex ? ["nofollow"] : [])];

Expand Down

0 comments on commit 9336f6b

Please sign in to comment.