From 1f197b98e11b1a888a3dae48ca1e41917e84d001 Mon Sep 17 00:00:00 2001 From: Malted Date: Sun, 22 Dec 2024 18:43:44 +0000 Subject: [PATCH] Add themes to stats image --- src/app/api/stats/route.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/api/stats/route.tsx b/src/app/api/stats/route.tsx index c7011604..ffe8eddb 100644 --- a/src/app/api/stats/route.tsx +++ b/src/app/api/stats/route.tsx @@ -6,9 +6,8 @@ const base = new Airtable({ apiKey: process.env.AIRTABLE_API_KEY }).base( process.env.BASE_ID!, ) -export async function GET() { +export async function GET({ url }) { let shipCount = await kv.get('ship-count') - console.log({ shipCount }) if (!shipCount) { console.log('Refetching ships') @@ -16,15 +15,16 @@ export async function GET() { shipCount = allShips.length.toString() await kv.set('ship-count', shipCount, { ex: 60_000, nx: true }) } - console.log({ shipCount }) + + const darkTheme = new URL(url).searchParams.get('theme') === 'dark' return new ImageResponse( (