Also scroll to top when location permission is granted (#2720)

This commit is contained in:
Johannes Klein
2025-03-06 21:05:51 +01:00
committed by GitHub
parent 9d0538c026
commit 2557936364

View File

@@ -153,6 +153,12 @@ const MatchContainer = ( ) => {
updateObservationKeys( { place_guess: currentPlaceGuess } );
}, [currentPlaceGuess, updateObservationKeys] );
const scrollToTop = useCallback( () => {
if ( scrollRef.current ) {
scrollRef.current.scrollTo( { y: 0, animated: true } );
}
}, [] );
const getCurrentUserLocation = async ( ) => {
const currentUserLocation = await fetchUserLocation( );
const placeGuess
@@ -180,6 +186,8 @@ const MatchContainer = ( ) => {
scoreImageParams: newScoreImageParams
} );
refetchSuggestions();
// Scroll to top of the screen
scrollToTop( );
};
const handleAddLocationPressed = ( ) => {
@@ -190,12 +198,6 @@ const MatchContainer = ( ) => {
}
};
const scrollToTop = useCallback( ( ) => {
if ( scrollRef.current ) {
scrollRef.current.scrollTo( { y: 0, animated: true } );
}
}, [] );
const onSuggestionChosen = useCallback( selection => {
const suggestionsList = [...orderedSuggestions];