mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Also scroll to top when location permission is granted (#2720)
This commit is contained in:
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user