()
| 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]); |
no test coverage detected