Ensure posts are not covered by the post draft on channel switch

This commit is contained in:
Elias Nahum 2022-05-05 18:25:46 -04:00
parent 58719c82dc
commit c7c00b8316
No known key found for this signature in database
GPG key ID: E038DB71E0B61702

View file

@ -116,8 +116,12 @@ const PostList = ({
}, [orderedPosts]);
useEffect(() => {
listRef.current?.scrollToOffset({offset: 0, animated: false});
}, [channelId]);
const t = setTimeout(() => {
listRef.current?.scrollToOffset({offset: 0, animated: false});
}, 200);
return () => clearTimeout(t);
}, [channelId, rootId]);
useEffect(() => {
const scrollToBottom = (screen: string) => {