刷新问题

This commit is contained in:
al 2024-08-13 16:00:40 +08:00
parent 44e5df6bd9
commit 1b5d4ef0af
1 changed files with 4 additions and 4 deletions

View File

@ -239,6 +239,7 @@ const FollowPostList = forwardRef(({ scrollHeight }, ref) => {
left: 0, left: 0,
behavior: "smooth", // 可选,平滑滚动效果 behavior: "smooth", // 可选,平滑滚动效果
}); });
// setFollowPostList([]);
await getFollowPostList(ids.current, 0); await getFollowPostList(ids.current, 0);
} }
async function loadMore() { async function loadMore() {
@ -288,8 +289,7 @@ const FollowPostList = forwardRef(({ scrollHeight }, ref) => {
} else { } else {
setFollowPostList((old) => { setFollowPostList((old) => {
if(followsResponse.data.offset==4){ if(!offset){
return followsResponse.data.list; return followsResponse.data.list;
}else{ }else{
return [...old, ...followsResponse.data.list] return [...old, ...followsResponse.data.list]
@ -321,8 +321,8 @@ const FollowPostList = forwardRef(({ scrollHeight }, ref) => {
))} ))}
{!followPostList?.length && ( {!followPostList?.length && (
<div <div
className={`flex flex-col items-center justify-center h-screen`} className={`flex flex-col items-center justify-center h-screen`}
// style={{ height: `${scrollHeight - 98}px` }} style={{ height: `calc(100vh - 133px)` }}
> >
<Empty type="nodata" /> <Empty type="nodata" />
</div> </div>