From 98e340a39abc91e0683c665503a216a4451930ba Mon Sep 17 00:00:00 2001 From: Pavel Prichodko <14926950+prichodko@users.noreply.github.com> Date: Tue, 14 Jun 2022 19:52:06 +0200 Subject: [PATCH] feat: filter out account from members --- packages/status-react/src/protocol/use-members.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/status-react/src/protocol/use-members.tsx b/packages/status-react/src/protocol/use-members.tsx index 66690438..4137e98a 100644 --- a/packages/status-react/src/protocol/use-members.tsx +++ b/packages/status-react/src/protocol/use-members.tsx @@ -2,9 +2,14 @@ import { useProtocol } from '~/src/protocol' import type { Member } from '@status-im/js' -// todo: remove in favor of useCommunity export const useMembers = (): Member[] => { - const { client } = useProtocol() + const { client, account } = useProtocol() + + if (account) { + return client.community.members.filter( + member => member.publicKey !== '0x' + account.publicKey + ) + } return client.community.members }