()
| 184 | |
| 185 | // Identify user if already authenticated |
| 186 | const identifyUser = async () => { |
| 187 | try { |
| 188 | const user = await window.desktopApi?.getUser() |
| 189 | if (user?.id) { |
| 190 | identify(user.id, { email: user.email, name: user.name }) |
| 191 | } |
| 192 | } catch (error) { |
| 193 | console.warn("[Analytics] Failed to identify user:", error) |
| 194 | } |
| 195 | } |
| 196 | identifyUser() |
| 197 | |
| 198 | // Cleanup on unmount |