feat: increase limit

This commit is contained in:
codytseng
2025-09-14 15:15:59 +08:00
parent ea99c445f6
commit 287564ee09

View File

@@ -28,7 +28,7 @@ import { useTranslation } from 'react-i18next'
import PullToRefresh from 'react-simple-pull-to-refresh'
import NoteCard, { NoteCardLoadingSkeleton } from '../NoteCard'
const LIMIT = 100
const LIMIT = 200
const ALGO_LIMIT = 500
const SHOW_COUNT = 10
@@ -166,7 +166,9 @@ const NoteList = forwardRef(
onNew: (event) => {
if (pubkey && event.pubkey === pubkey) {
// If the new event is from the current user, insert it directly into the feed
setEvents((oldEvents) => (oldEvents.some((e) => e.id === event.id) ? oldEvents : [event, ...oldEvents]))
setEvents((oldEvents) =>
oldEvents.some((e) => e.id === event.id) ? oldEvents : [event, ...oldEvents]
)
} else {
// Otherwise, buffer it and show the New Notes button
setNewEvents((oldEvents) =>
@@ -201,7 +203,7 @@ const NoteList = forwardRef(
if (showCount < events.length) {
setShowCount((prev) => prev + SHOW_COUNT)
// preload more
if (events.length - showCount > SHOW_COUNT * 5) {
if (events.length - showCount > LIMIT / 2) {
return
}
}