From 04774bc1804b58cc25337d334a4034b9318f6a2e Mon Sep 17 00:00:00 2001 From: SkateSpots Date: Mon, 5 Oct 2026 20:00:44 +0700 Subject: [PATCH] fix(stats): validate kind-30017 with parseSkateShop so foreign shops leave Top Shops --- src/hooks/useGrowthStats.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hooks/useGrowthStats.ts b/src/hooks/useGrowthStats.ts index ec49cba..65b8375 100644 --- a/src/hooks/useGrowthStats.ts +++ b/src/hooks/useGrowthStats.ts @@ -3,6 +3,7 @@ import { useSkateRelays } from '@/hooks/useSkateRelays'; import { SKATE_SPOT_KIND, SKATE_SHOP_KIND, + parseSkateShop, CALENDAR_EVENT_KIND, SKATE_COACH_KIND, SKATE_FILMER_KIND, @@ -223,7 +224,7 @@ export function useGrowthStats() { tradeEvents, ] = await Promise.all([ querySkateContent([{ kinds: [SKATE_SPOT_KIND], '#t': ['skatespot'], limit: 2000 }], { signal }).catch(() => []), - querySkateContent([{ kinds: [SKATE_SHOP_KIND], limit: 2000 }], { signal }).catch(() => []), + querySkateContent([{ kinds: [SKATE_SHOP_KIND], '#t': ['skateshop'], limit: 2000 }], { signal }).catch(() => []), querySkateContent([{ kinds: [CALENDAR_EVENT_KIND], '#t': ['skateboarding'], limit: 2000 }], { signal }).catch(() => []), querySkateContent([{ kinds: [SKATE_COACH_KIND], limit: 500 }], { signal }).catch(() => []), querySkateContent([{ kinds: [SKATE_FILMER_KIND], limit: 500 }], { signal }).catch(() => []), @@ -263,7 +264,11 @@ export function useGrowthStats() { } const spots = dedup(spotEvents); - const shops = dedup(shopEvents); + // Shops: run the SAME validator the directory uses — kind 30017 is not a + // reserved kind, so other apps (zap.cooking, agent stalls, …) publish + // unrelated events under it on shared relays. Counting raw events put + // those on the "Top Shops" board, labelled with the author's profile name. + const shops = dedup(shopEvents.filter((e) => parseSkateShop(e) !== null)); const events = dedup(calendarEvents); const coaches = dedup(coachEvents); const filmers = dedup(filmerEvents);