mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-30 01:06:22 +02:00
🐛 Make sure switches are controlled
This commit is contained in:
parent
0b808259ab
commit
309820f072
1 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue