mirror of
https://github.com/headporter81/ss-front-react.git
synced 2026-12-06 07:41:11 +09:00
fix : 무한 스크롤 중복·누락 수정 (안 읽은 글은 id 커서 방식으로 조회)
SpecialSource Frontend (React) CD / deploy (push) Successful in 13s
SpecialSource Frontend (React) CD / deploy (push) Successful in 13s
- 스크롤 중 새 글이 스크랩되거나 글을 읽어 순서가 밀리면 다음 페이지에 중복·누락이 생기던 문제 - 안 읽은 글: before(마지막 글 id) 커서로 다음 페이지 조회 (백엔드 before 파라미터 필요) - 읽은 글: 페이지 번호 방식 유지, 이미 받은 글은 걸러냄 - 요청 사이 목록이 바뀌었으면 늦게 온 응답은 버림 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d94aaa6f0a
commit
cbc41ef444
3 files changed
+26
-12
No files matched your search
@@ -102,10 +102,10 @@ export default function BbsTerminal() {
|
||||
const f = state.feed;
|
||||
if (!state.token || !f || f.last || loadingMore.current) return;
|
||||
loadingMore.current = true;
|
||||
fetchFeed(state.token, f.kind, f.board, f.page + 1)
|
||||
fetchFeed(state.token, f.kind, f.board, f)
|
||||
.then((more) => {
|
||||
loadingMore.current = false;
|
||||
dispatch({ more });
|
||||
dispatch({ more, after: f });
|
||||
})
|
||||
.catch((e) => dispatch(apiError(e))); // 실패하면 잠금을 풀지 않음 → 무한 재시도 방지. "L"(새로고침)하면 풀림
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user