MCPcopy
hub / github.com/stravu/crystal / checkAnalyticsConsent

Function checkAnalyticsConsent

frontend/src/App.tsx:78–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 const checkAnalyticsConsent = async () => {
79 if (!window.electron?.invoke) {
80 return;
81 }
82
83 try {
84 // Check if consent has already been shown
85 const consentResult = await window.electron.invoke('preferences:get', 'analytics_consent_shown') as IPCResponse<string>;
86 const hasShownConsent = consentResult?.data === 'true';
87
88 if (!hasShownConsent) {
89 // Show consent dialog
90 setIsAnalyticsConsentOpen(true);
91 }
92 } catch (error) {
93 console.error('[App] Error checking analytics consent:', error);
94 }
95 };
96
97 setHasCheckedAnalyticsConsent(true);
98 checkAnalyticsConsent();

Callers 1

AppFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected