MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / toggleFlag

Function toggleFlag

client/src/components/settings/privacy.tsx:41–46  ·  view source on GitHub ↗
(flag: keyof ProfileUI)

Source from the content-addressed store, hash-verified

39 const [madeChanges, setMadeChanges] = useState(false);
40
41 function toggleFlag(flag: keyof ProfileUI): () => void {
42 return () => {
43 setMadeChanges(true);
44 setPrivacyValues({ ...privacyValues, [flag]: !privacyValues[flag] });
45 };
46 }
47
48 function submitNewProfileSettings(e: React.FormEvent) {
49 e.preventDefault();

Callers 1

PrivacySettingsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected