Skip to content

Commit

Permalink
JS sample app fix for Contacts issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rleojoseph committed Feb 8, 2024
1 parent 83b9a9b commit 3bd7b4b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions js-miniapp-sample/src/pages/user-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ function UserDetails(props: UserDetailsProps) {
'Page',
''
);
props.contactList = undefined;
});

function requestNamePhoto() {
Expand Down Expand Up @@ -376,7 +377,7 @@ function UserDetails(props: UserDetailsProps) {
description: 'We would like to send messages to your contacts.',
},
];

props.contactList = undefined
props
.requestPermissions(permissionsList)
.then((permissions) => filterAllowedPermissions(permissions))
Expand All @@ -402,7 +403,10 @@ function UserDetails(props: UserDetailsProps) {
'We would like to display your Points on your profile page.',
},
];
props.points = undefined;
if (props !== undefined) {
props.points = undefined;
}


props
.requestPermissions(permissionsList)
Expand Down Expand Up @@ -570,7 +574,7 @@ function UserDetails(props: UserDetailsProps) {
}}
/>
<Paper className={classes.paper}>
{hasContactsPermision && props.contactList && (
{hasContactsPermision && !state.isContactsError && props.contactList && (
<CardHeader
subheader={'Contact List: ' + props.contactList.length}
/>
Expand All @@ -585,6 +589,7 @@ function UserDetails(props: UserDetailsProps) {
</ListItem>
)}
{hasContactsPermision &&
!state.isContactsError &&
props.contactList &&
dataFiltered.map((contact) => (
<ListItem divider>
Expand Down

0 comments on commit 3bd7b4b

Please sign in to comment.