From a9c4f7e52d3a1ed01c2bf526da4d4014419e07ba Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Thu, 16 May 2024 17:41:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Improve=20handling=20of=20hidden?= =?UTF-8?q?=20participants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/components/poll/desktop-poll.tsx | 10 +++++++--- apps/web/src/components/scheduled-event.tsx | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/poll/desktop-poll.tsx b/apps/web/src/components/poll/desktop-poll.tsx index 411f94d92..b36e17994 100644 --- a/apps/web/src/components/poll/desktop-poll.tsx +++ b/apps/web/src/components/poll/desktop-poll.tsx @@ -29,7 +29,10 @@ import { useVotingForm } from "@/components/poll/voting-form"; import { usePermissions } from "@/contexts/permissions"; import { usePoll } from "@/contexts/poll"; -import { useVisibleParticipants } from "../participants-provider"; +import { + useParticipants, + useVisibleParticipants, +} from "../participants-provider"; import ParticipantRow from "./desktop-poll/participant-row"; import ParticipantRowForm from "./desktop-poll/participant-row-form"; import PollHeader from "./desktop-poll/poll-header"; @@ -99,6 +102,7 @@ const DesktopPoll: React.FunctionComponent = () => { const votingForm = useVotingForm(); const mode = votingForm.watch("mode"); + const { participants } = useParticipants(); const visibleParticipants = useVisibleParticipants(); const scrollRef = React.useRef(null); @@ -228,7 +232,7 @@ const DesktopPoll: React.FunctionComponent = () => { - {visibleParticipants.length} + {participants.length} {canAddNewParticipant && mode !== "new" ? (