()
| 20 | * unauthenticated errors aren't attributed to the last signed-in user. |
| 21 | */ |
| 22 | export const SentryUserSync = (): null => { |
| 23 | const me = useMe(); |
| 24 | const userId = me.data?.user.id; |
| 25 | const userEmail = me.data?.user.email; |
| 26 | |
| 27 | useEffect(() => { |
| 28 | if (userId !== undefined && userEmail !== undefined) { |
| 29 | Sentry.setUser({ id: userId, email: userEmail }); |
| 30 | |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | Sentry.setUser(null); |
| 35 | }, [userId, userEmail]); |
| 36 | |
| 37 | return null; |
| 38 | }; |