From 18953ebc9a6738b1aa2eb4ce5fc9dfea1f4d7e3c Mon Sep 17 00:00:00 2001 From: jinghui <3970260761@qq.com> Date: Tue, 10 Nov 2026 15:56:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20/filter=20=E9=A1=B5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=EF=BC=88reset=E6=97=B6=E6=9C=AA?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0arr=EF=BC=89=20(fixed117)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++-- src/app/filter/page.tsx | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d38fe63..a1dd77b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN find ./src -type f -name "route.ts" -print0 \ ENV DOCKER_ENV=true # 海报走站内 /api/image-proxy(浏览器直连豆瓣图被拦导致全裂) ENV NEXT_PUBLIC_IMAGE_PROXY=/api/image-proxy -ENV NEXT_PUBLIC_SITE_VERSION=fixed110 +ENV NEXT_PUBLIC_SITE_VERSION=fixed117 ENV NEXT_PUBLIC_ENABLE_REGISTER=true # For Docker builds, force dynamic rendering to read runtime environment variables. @@ -56,7 +56,7 @@ ENV HOSTNAME=0.0.0.0 ENV PORT=3000 ENV DOCKER_ENV=true ENV NEXT_PUBLIC_IMAGE_PROXY=/api/image-proxy -ENV NEXT_PUBLIC_SITE_VERSION=fixed110 +ENV NEXT_PUBLIC_SITE_VERSION=fixed117 ENV NEXT_PUBLIC_ENABLE_REGISTER=true # 从构建器中复制 standalone 输出 diff --git a/src/app/filter/page.tsx b/src/app/filter/page.tsx index 66e65b6..d0fe422 100644 --- a/src/app/filter/page.tsx +++ b/src/app/filter/page.tsx @@ -200,7 +200,7 @@ function FilterClient() { } const arr: Item[] = Array.isArray(j?.list) ? j.list : []; setItems((prev) => { - const base = reset ? [] : [...prev, ...arr]; + const base = reset ? [...arr] : [...prev, ...arr]; const seen = new Set(); return base.filter((x) => { const k = x.title + '|' + x.year; @@ -231,6 +231,12 @@ function FilterClient() { load(1, true); }, [source, cat, area, year]); + // 兜底:首次挂载确保加载一次(避免条件 effect 漏触发) + useEffect(() => { + load(1, true); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + // 分页:上一页/下一页 const goPage = (pg: number) => { if (pg < 1) return;