refactor: session message count badge and DnD files

This commit is contained in:
zerosoul
2022-06-14 20:55:49 +08:00
parent 405824d582
commit 75ba278618
5 changed files with 104 additions and 47 deletions
+13 -10
View File
@@ -148,16 +148,19 @@ export default function useMessageFeed({ context = "channel", id = null }) {
}
pageRef.current = pageInfo;
listRef.current = [...pageInfo.ids, ...listRef.current];
setTimeout(() => {
setItems(listRef.current);
console.log("pull up", currPageInfo, listRef.current);
setHasMore(pageInfo.pageNumber !== 1);
const container = containerRef.current;
if (container) {
curScrollPos = container.scrollTop;
oldScroll = container.scrollHeight - container.clientHeight;
}
}, 800);
setTimeout(
() => {
setItems(listRef.current);
console.log("pull up", currPageInfo, listRef.current);
setHasMore(pageInfo.pageNumber !== 1);
const container = containerRef.current;
if (container) {
curScrollPos = container.scrollTop;
oldScroll = container.scrollHeight - container.clientHeight;
}
},
currPageInfo.isLast ? 10 : 800
);
};
const pullDown = () => {
// 向下加载