File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/interface-default/src Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -53,13 +53,13 @@ const ConsentForm: React.FC<ConsentFormProps> = ({
53
53
} , [ integrations ] )
54
54
55
55
const defaultState = useMemo ( ( ) => {
56
- const initialState : FormState = { }
56
+ const defaultState : FormState = { }
57
57
58
58
for ( const integration of integrations ) {
59
- initialState [ integration . id ] = integration . enabledByDefault || false
59
+ defaultState [ integration . id ] = integration . enabledByDefault || false
60
60
}
61
61
62
- return initialState
62
+ return defaultState
63
63
} , [ integrations ] )
64
64
65
65
const [ formState , setFormState ] = useState < FormState > ( initialState )
@@ -75,9 +75,10 @@ const ConsentForm: React.FC<ConsentFormProps> = ({
75
75
onSubmit ( { enabled } )
76
76
} , [ onSubmit , setFormVisible , formState ] )
77
77
78
- const cbReset = useCallback ( ( ) => {
79
- setFormState ( defaultState )
80
- } , [ setFormState , initialState ] )
78
+ const cbReset = useCallback (
79
+ ( ) => setFormState ( { ...defaultState } ) ,
80
+ [ setFormState , defaultState ]
81
+ )
81
82
82
83
const cbEnableAll = useCallback ( ( ) => {
83
84
setFormState ( ( state ) => {
You can’t perform that action at this time.
0 commit comments