| 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(); |