497ef876bb
- Integrate Recapt session tracking with user identity in dashboard layout - Remove push-notifications extension from settings, panel registry, and toggle list - Fix journal entry preview overflow on narrow viewports - Update transaction manual booking button label - Clarify invoice email error message to reference env vars Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
799 B
TypeScript
46 lines
799 B
TypeScript
'use client'
|
|
|
|
import { useEffect } from 'react'
|
|
|
|
declare global {
|
|
interface Window {
|
|
Recapt?: {
|
|
session: {
|
|
setIdentity: (identity: {
|
|
uid: string
|
|
email?: string
|
|
nickname?: string
|
|
fullName?: string
|
|
}) => void
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export function RecaptIdentify({
|
|
userId,
|
|
email,
|
|
displayName,
|
|
}: {
|
|
userId: string
|
|
email?: string
|
|
displayName?: string
|
|
}) {
|
|
useEffect(() => {
|
|
const interval = setInterval(() => {
|
|
if (window.Recapt) {
|
|
window.Recapt.session.setIdentity({
|
|
uid: userId,
|
|
email: email,
|
|
fullName: displayName,
|
|
})
|
|
clearInterval(interval)
|
|
}
|
|
}, 500)
|
|
|
|
return () => clearInterval(interval)
|
|
}, [userId, email, displayName])
|
|
|
|
return null
|
|
}
|