Skip to content

Commit

Permalink
Reverted conversation scroll changes from #200
Browse files Browse the repository at this point in the history
  • Loading branch information
duogenesis committed Feb 29, 2024
1 parent bda8265 commit c333cf9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions components/conversation-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ const ConversationScreen = ({navigation, route}) => {
const scrollToEnd = useCallback(() => {
if (listRef.current && !hasScrolled.current) {
listRef.current.scrollToEnd({animated: true});
hasScrolled.current = true;
}
}, [listRef.current]);
scrollToEnd();

const onPressSend = useCallback(async (text: string): Promise<MessageStatus> => {
const isFirstMessage = messages === null || messages.length === 0;
Expand Down Expand Up @@ -354,9 +354,6 @@ const ConversationScreen = ({navigation, route}) => {
return layoutMeasurement.height + contentOffset.y >=
contentSize.height - paddingToBottom;
};
const isAtBottom = ({layoutMeasurement, contentOffset, contentSize}) => {
return layoutMeasurement.height + contentOffset.y >= contentSize.height;
};

const onScroll = useCallback(({nativeEvent}) => {
if (isCloseToTop(nativeEvent) && hasFinishedFirstLoad.current) {
Expand All @@ -365,9 +362,6 @@ const ConversationScreen = ({navigation, route}) => {
if (isCloseToBottom(nativeEvent)) {
hasFinishedFirstLoad.current = true;
}
if (isAtBottom(nativeEvent)) {
hasScrolled.current = true;
}
}, [maybeLoadNextPage]);

useEffect(() => {
Expand Down

0 comments on commit c333cf9

Please sign in to comment.