Skip to content

Commit

Permalink
fix: use controller to track the switch status
Browse files Browse the repository at this point in the history
  • Loading branch information
Alonza0314 committed Feb 9, 2025
1 parent a75c6b3 commit 8e2c3c3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions frontend/src/pages/SubscriberCreate/SubscriberFormSessions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,14 @@ export default function SubscriberFormSessions() {
<TableBody>
<TableRow>
<TableCell style={{ width: "10%" }}>
<Switch
{...register(
`SnssaiConfigurations.${index}.dnnConfigurations.${dnn}.enableStaticIpv4Address`,
<Controller
control={control}
name={`SnssaiConfigurations.${index}.dnnConfigurations.${dnn}.enableStaticIpv4Address`}
render={({ field }) => (
<Switch
checked={field.value}
onChange={(e) => field.onChange(e.target.checked)}
/>
)}
/>
</TableCell>
Expand Down

0 comments on commit 8e2c3c3

Please sign in to comment.