Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🔥 Remove unused urlId prop from legacy poll context

Luke Vellaae5add9158eb
diff --git a/apps/web/src/components/poll-context.tsx b/apps/web/src/components/poll-context.tsx
index d9514bb65..b776c403e 100644
--- a/apps/web/src/components/poll-context.tsx
+++ b/apps/web/src/components/poll-context.tsx
@@ -16,7 +16,6 @@ import { useRequiredContext } from "./use-required-context";
type PollContextValue = {
poll: GetPollApiResponse;
- urlId: string;
highScore: number;
optionIds: string[];
getScore: (optionId: string) => {
@@ -39,9 +38,8 @@ export const usePoll = () => {
export const PollContextProvider: React.FunctionComponent<{
poll: GetPollApiResponse;
- urlId: string;
children?: React.ReactNode;
-}> = ({ poll, urlId, children }) => {
+}> = ({ poll, children }) => {
const { t } = useTranslation();
const { participants } = useParticipants();
@@ -83,7 +81,6 @@ export const PollContextProvider: React.FunctionComponent<{
return {
optionIds,
poll,
- urlId,
highScore,
getVote: (participantId, optionId) => {
const vote = participants
@@ -93,7 +90,7 @@ export const PollContextProvider: React.FunctionComponent<{
},
getScore,
};
- }, [getScore, participants, poll, urlId]);
+ }, [getScore, participants, poll]);
if (poll.deleted) {
return (
diff --git a/apps/web/src/components/poll/poll-context-provider.tsx b/apps/web/src/components/poll/poll-context-provider.tsx
index 9a62dda15..688f79a58 100644
--- a/apps/web/src/components/poll/poll-context-provider.tsx
+++ b/apps/web/src/components/poll/poll-context-provider.tsx
@@ -13,7 +13,7 @@ export const LegacyPollContextProvider = (props: React.PropsWithChildren) => {
}
return (
- <PollContextProvider poll={poll} urlId={poll.id}>
+ <PollContextProvider poll={poll}>
<ModalProvider>
<OptionsProvider>{props.children}</OptionsProvider>
</ModalProvider>