🐛 Make sure switches are controlled

This commit is contained in:
Luke Vella 2024-09-21 15:27:44 +01:00
parent 0b808259ab
commit 309820f072
No known key found for this signature in database
GPG key ID: 469CAD687F0D784C

View file

@ -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();