MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / onChange

Function onChange

apps/web/ui/ConfigurationsView/AnonymizeUsersRow/index.tsx:17–30  ·  view source on GitHub ↗
(type: AnonymizeType)

Source from the content-addressed store, hash-verified

15 const [anonymize, setAnonymize] = useState(currentCommunity.anonymize);
16
17 async function onChange(type: AnonymizeType) {
18 api
19 .updateAccount({
20 accountId: currentCommunity.id,
21 anonymize: type,
22 anonymizeUsers:
23 type === AnonymizeType.MEMBERS || type === AnonymizeType.ALL,
24 })
25 .then((_) => {
26 Toast.success('Saved successfully!');
27 setAnonymize(type);
28 })
29 .catch(() => Toast.error('Something went wrong!'));
30 }
31
32 return (
33 <>

Callers 4

AnonymizeCardFunction · 0.70
CommunityChatRowFunction · 0.50
CommunityTypeRowFunction · 0.50
handleChangeFunction · 0.50

Calls 2

successMethod · 0.80
errorMethod · 0.65

Tested by

no test coverage detected