got rid of useless scrollPos variable

This commit is contained in:
Carter 2024-12-06 10:18:15 -06:00
parent 48549bf4de
commit 558bed357a
2 changed files with 0 additions and 10 deletions

View file

@ -20,14 +20,7 @@ export default function Chat(props: Props) {
const [loaded, setLoaded] = useState<boolean>(false);
const [loading, setLoading] = useState<boolean>(false);
const [totalMessages, setTotalMessages] = useState(0);
const [scrollPos, setScrollPos] = useState(0);
const [{ user }] = useGlobalState();
// const [attachmentMap, setAttachmentMap] = useState<Map<string, pond.FileReference[]>>(new Map());
useEffect(() => {
console.log(scrollPos)
}, [scrollPos])
const loadChats = () => {
setLoading(true)
@ -35,7 +28,6 @@ export default function Chat(props: Props) {
// if (loaded) setScrollPos(chats.length-10)
// setScrollPos(chats.length)
setChats(resp.data.chats ? resp.data.chats.reverse().concat(chats) : [])
setScrollPos(resp.data.chats.reverse().concat(chats).length)
setTotalMessages(resp.data.total)
}).finally(() => {
setLoading(false)
@ -93,7 +85,6 @@ export default function Chat(props: Props) {
totalMessages={totalMessages}
// attachmentMap={attachmentMap}
messages={chats}
scrollPos={scrollPos}
removeNoteMethod={removeNote}
loadMore={loadMore}
/>