MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / handleCheckboxChange

Function handleCheckboxChange

apps/OpenSign/src/pages/Preferences.jsx:152–165  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

150
151 // `handleCheckboxChange` is trigger when user enable/disable checkbox of respective type
152 const handleCheckboxChange = (index) => {
153 // // Create a copy of the signatureType array
154 // const updatedSignatureType = [...signatureType];
155 // // Toggle the enabled value for the clicked item
156 // updatedSignatureType[index].enabled = !updatedSignatureType[index].enabled;
157 // // Update the state with the modified array
158 // setSignatureType(updatedSignatureType);
159
160 setSignatureType((prev) =>
161 prev.map((item, i) =>
162 i === index ? { ...item, enabled: !item.enabled } : item
163 )
164 );
165 };
166
167 // `handleSave` is used save updated value signature type
168 const handleSave = withSessionValidation(async () => {

Callers 1

PreferencesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected