chore: quick fix

This commit is contained in:
daniyal 2024-08-08 21:56:30 +05:00
parent 7b9c95c863
commit 44d0100341
3 changed files with 5 additions and 3 deletions

View File

@ -1 +1,2 @@
export const T_TAG_VALUE = 'GameMod'
export const MOD_FILTER_LIMIT = 20

View File

@ -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 = () => {
<Pagination
page={page}
disabledNext={mods.length < 20}
disabledNext={mods.length < MOD_FILTER_LIMIT}
handlePrev={handlePrev}
handleNext={handleNext}
/>

View File

@ -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