commented test code

This commit is contained in:
Nouman Tahir 2023-02-24 20:53:01 +05:00
parent f5b3065878
commit 65841ed0a1
2 changed files with 18 additions and 31 deletions

View File

@ -136,27 +136,27 @@ const postsListContainer = (
//TODO: test hook, remove before PR
useEffect(() => {
if (scrollIndex && flatListRef.current) {
const _posts = data
console.log("scrollIndex", scrollIndex, "posts length", _posts.length);
// useEffect(() => {
// if (scrollIndex && flatListRef.current) {
// const _posts = data
// console.log("scrollIndex", scrollIndex, "posts length", _posts.length);
if (scrollIndex >= _posts.length) {
Alert.alert("Reached an end, scroll score, " + scrollIndex);
return;
}
// if (scrollIndex >= _posts.length) {
// Alert.alert("Reached an end, scroll score, " + scrollIndex);
// return;
// }
if (scrollIndex === _posts.length - 15) {
console.log("fetching posts");
onLoadPosts(false);
}
// if (scrollIndex === _posts.length - 15) {
// console.log("fetching posts");
// onLoadPosts(false);
// }
flatListRef.current.scrollToIndex({ index: scrollIndex });
setTimeout(() => {
_handleOnContentPress(_posts[scrollIndex])
}, 500)
}
}, [scrollIndex])
// flatListRef.current.scrollToIndex({ index: scrollIndex });
// setTimeout(() => {
// _handleOnContentPress(_posts[scrollIndex])
// }, 500)
// }
// }, [scrollIndex])
useEffect(() => {

View File

@ -11,7 +11,6 @@ import { postQueries } from '../../../providers/queries';
const PostScreen = ({
navigation,
route
}) => {
@ -65,14 +64,6 @@ const PostScreen = ({
getPostQuery.refetch();
};
// // useEffect(() => {
// // const { isFetch: nextIsFetch } = route.params ?? {};
// // if (nextIsFetch) {
// // const { author: _author, permlink } = route.params;
// // _loadPost(_author, permlink);
// // }
// // }, [route.params.isFetch]);
const _isPostUnavailable = !getPostQuery.isLoading && getPostQuery.error;
@ -117,10 +108,6 @@ const PostScreen = ({
ref={postOptionsModalRef}
/>
</View>
// <ScrollView>
// <Text>{params.content.body}</Text>
// </ScrollView>
);
};