Skip to content

Commit

Permalink
[native] fix viewer user profile bototm sheet snap point
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ginsueddy committed Oct 11, 2023
1 parent d41f80f commit 6794479
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===
Expand All @@ -56,6 +59,7 @@ function UserProfileRelationshipButton(props: Props): React.Node {
setUserProfileRelationshipButtonHeight(userProfileActionButtonHeight);
}
}, [
otherUserInfo,
otherUserInfo?.relationshipStatus,
setUserProfileRelationshipButtonHeight,
]);
Expand Down

0 comments on commit 6794479

Please sign in to comment.