MCPcopy Create free account
hub / github.com/winfunc/opcode / checkConsent

Function checkConsent

src/components/AnalyticsConsent.tsx:29–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27 useEffect(() => {
28 // Check if we should show the consent dialog
29 const checkConsent = async () => {
30 await analytics.initialize();
31 const settings = analytics.getSettings();
32
33 if (!settings?.hasConsented && !hasShownConsent) {
34 if (!isControlled) {
35 setInternalOpen(true);
36 }
37 setHasShownConsent(true);
38 }
39 };
40
41 checkConsent();
42 }, [isControlled, hasShownConsent]);

Callers 1

AnalyticsConsentFunction · 0.85

Calls 2

initializeMethod · 0.45
getSettingsMethod · 0.45

Tested by

no test coverage detected