From 6794479a1d2642374f2ba3f25c37cba78ae3926e Mon Sep 17 00:00:00 2001 From: Ginsu Eddy Date: Wed, 11 Oct 2023 05:36:25 -0400 Subject: [PATCH] [native] fix viewer user profile bototm sheet snap point Summary: This fixes a small bug with our user profile bottom sheet snap point logic when a viewer was viewing their own user profile Depends on D9394 Test Plan: Please see the screenshots below Before: {F794548} After: {F794551} Reviewers: atul, inka Reviewed By: atul Subscribers: ashoat, tomek, wyilio Differential Revision: https://phab.comm.dev/D9395 --- .../user-profile/user-profile-relationship-button.react.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/native/user-profile/user-profile-relationship-button.react.js b/native/user-profile/user-profile-relationship-button.react.js index d1cf975b94..9c4586e758 100644 --- a/native/user-profile/user-profile-relationship-button.react.js +++ b/native/user-profile/user-profile-relationship-button.react.js @@ -41,7 +41,10 @@ function UserProfileRelationshipButton(props: Props): React.Node { ); React.useLayoutEffect(() => { - if (otherUserInfo?.relationshipStatus === userRelationshipStatus.FRIEND) { + if ( + !otherUserInfo || + otherUserInfo.relationshipStatus === userRelationshipStatus.FRIEND + ) { setUserProfileRelationshipButtonHeight(0); } else if ( otherUserInfo?.relationshipStatus === @@ -56,6 +59,7 @@ function UserProfileRelationshipButton(props: Props): React.Node { setUserProfileRelationshipButtonHeight(userProfileActionButtonHeight); } }, [ + otherUserInfo, otherUserInfo?.relationshipStatus, setUserProfileRelationshipButtonHeight, ]);