페이징 처리 조건 수정

This commit is contained in:
focp212@naver.com
2025-10-26 11:08:53 +09:00
parent 00aec7656e
commit 35edb19062
17 changed files with 174 additions and 66 deletions

View File

@@ -34,8 +34,7 @@ import useIntersectionObserver from '@/widgets/intersection-observer';
export const BillingListPage = () => {
const { navigate } = useNavigate();
const userMid = useStore.getState().UserStore.mid;
const userInfo = useStore((state) => state.UserStore.userInfo);
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
const [sortType, setSortType] = useState<SortTypeKeys>(SortTypeKeys.LATEST);
const [listItems, setListItems] = useState<Array<ListItemProps>>([]);
@@ -115,19 +114,24 @@ export const BillingListPage = () => {
else{
setListItems(rs.content);
}
if(rs.hasNext){
if(rs.hasNext
&& rs.content.length === DEFAULT_PAGE_PARAM.size
){
setPageParam({
...pageParam,
...{ cursor: rs.nextCursor }
});
setOnActionIntersect(true);
}
else{
setPageParam({
...pageParam,
...{ cursor: null }
});
}
}
setOnActionIntersect(
!!rs.hasNext
&& rs.content.length === DEFAULT_PAGE_PARAM.size
);
});
}