diff --git a/src/constants.ts b/src/constants.ts index 79661bc..d141103 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1 +1,2 @@ export const T_TAG_VALUE = 'GameMod' +export const MOD_FILTER_LIMIT = 20 diff --git a/src/pages/mods.tsx b/src/pages/mods.tsx index 00cd090..76ccb20 100644 --- a/src/pages/mods.tsx +++ b/src/pages/mods.tsx @@ -19,6 +19,7 @@ import '../styles/search.css' import '../styles/styles.css' import { ModDetails, MuteLists } from '../types' import { fetchMods } from '../utils' +import { MOD_FILTER_LIMIT } from '../constants' enum SortBy { Latest = 'Latest', @@ -190,7 +191,7 @@ export const ModsPage = () => { diff --git a/src/utils/mod.ts b/src/utils/mod.ts index b85376f..5811756 100644 --- a/src/utils/mod.ts +++ b/src/utils/mod.ts @@ -4,7 +4,7 @@ import { ModFormState, ModDetails } from '../types' import { RelayController } from '../controllers' import { log, LogType } from './utils' import { toast } from 'react-toastify' -import { T_TAG_VALUE } from '../constants' +import { MOD_FILTER_LIMIT, T_TAG_VALUE } from '../constants' /** * Extracts and normalizes mod data from an event. @@ -151,7 +151,7 @@ export const fetchMods = async ( // Define the filter criteria for fetching mods const filter: Filter = { kinds: [kinds.ClassifiedListing], // Specify the kind of events to fetch - limit: 20, // Limit the number of events fetched to 20 + limit: MOD_FILTER_LIMIT, // Limit the number of events fetched to 20 '#t': [T_TAG_VALUE], until, // Optional filter to fetch events until this timestamp since // Optional filter to fetch events from this timestamp