Skip to content

Commit

Permalink
fix: group invite member
Browse files Browse the repository at this point in the history
  • Loading branch information
agazso committed Dec 1, 2023
1 parent 058b085 commit 092690b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/routes/group/chat/[id]/edit/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import Loading from '$lib/components/loading.svelte'
import { userDisplayName } from '$lib/utils/user'
import { errorStore } from '$lib/stores/error'
import { fixHex } from '$lib/adapters/waku/crypto'
$: chatId = $page.params.id
$: groupChat = $chats.chats.get(chatId)
Expand Down Expand Up @@ -84,7 +85,8 @@
}
function isGroupMember(publicKey: string) {
return groupChat?.users.map((user) => user.publicKey).includes(publicKey)
publicKey = fixHex(publicKey)
return groupChat?.users.map((user) => fixHex(user.publicKey)).includes(publicKey)
}
$: if (
Expand Down Expand Up @@ -244,7 +246,7 @@
{@const otherUser = chat.users.find(
(u) => u.publicKey !== wallet.signingKey.compressedPublicKey,
)}
{#if otherUser && !isGroupChat(chat) && !isGroupMember(id)}
{#if otherUser && !isGroupChat(chat) && !isGroupMember(otherUser.publicKey)}
<li>
<label for={id}>
<div class="chat-button" role="listitem">
Expand Down

0 comments on commit 092690b

Please sign in to comment.