Skip to content

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

🐛 Make sure switches are controlled

Luke Vella309820f072ee
diff --git a/apps/web/src/components/forms/poll-settings.tsx b/apps/web/src/components/forms/poll-settings.tsx
index 9ba7508db..65547d2c3 100644
--- a/apps/web/src/components/forms/poll-settings.tsx
+++ b/apps/web/src/components/forms/poll-settings.tsx
@@ -105,7 +105,7 @@ export const PollSettingsForm = ({ children }: React.PropsWithChildren) => {
</SettingContent>
<Switch
id={field.name}
- checked={field.value}
+ checked={!!field.value}
onCheckedChange={(checked) => {
field.onChange(checked);
}}
@@ -128,7 +128,7 @@ export const PollSettingsForm = ({ children }: React.PropsWithChildren) => {
</SettingTitle>
</SettingContent>
<Switch
- checked={field.value}
+ checked={!!field.value}
onCheckedChange={(checked) => {
if (isFree) {
paywallDialog.trigger();
@@ -159,7 +159,7 @@ export const PollSettingsForm = ({ children }: React.PropsWithChildren) => {
</SettingTitle>
</SettingContent>
<Switch
- checked={field.value}
+ checked={!!field.value}
onCheckedChange={(checked) => {
if (isFree) {
paywallDialog.trigger();
@@ -191,7 +191,7 @@ export const PollSettingsForm = ({ children }: React.PropsWithChildren) => {
</SettingContent>
<Switch
id={field.name}
- checked={field.value}
+ checked={!!field.value}
onCheckedChange={(checked) => {
if (isFree) {
paywallDialog.trigger();