페이징 처리 조건 수정
This commit is contained in:
@@ -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
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user