Merge pull request #161 from project-error/fix/message-issues

Fix checking if contact exist
This commit is contained in:
Christopher Gjelten authored and GitHub committed 2021-03-11 15:09:00 +01:00
commit d841ee0958
2 files changed
+17 -6

No files matched your search

@@ -74,6 +74,16 @@ InjectDebugData([
updatedAt: Date.now(),
unreadCount: 0,
},
{
groupId: '4',
groupDisplay: 'Dick',
isGroupChat: false,
phoneNumbers: ['111-1134', '111-2342'],
avatar: null,
label: null,
updatedAt: Date.now(),
unreadCount: 0,
},
],
},
]);
@@ -117,6 +117,8 @@ export const MessageModal = () => {
const phoneNumbers = activeMessageGroup?.phoneNumbers || [];
const targetNumber = phoneNumbers.find((n) => myNumber !== n);
return (
<div>
<Modal visible={groupActionsOpen} handleClose={() => setGroupActionsOpen(false)}>
@@ -153,14 +155,13 @@ export const MessageModal = () => {
<Button>
<MoreVertIcon onClick={() => setGroupActionsOpen(true)} fontSize="large" />
</Button>
) : (
) : null}
{!activeMessageGroup?.isGroupChat &&
getDisplayByNumber(targetNumber) == targetNumber ? (
<Button>
<PersonAddIcon
onClick={() => handleAddContact(phoneNumbers.find((n) => myNumber !== n))}
fontSize="large"
/>
<PersonAddIcon onClick={() => handleAddContact(targetNumber)} fontSize="large" />
</Button>
)}
) : null}
</Box>
</Paper>
{isLoaded ? (