From 393339cdde668f631b95c34f80129c7a60f8ae26 Mon Sep 17 00:00:00 2001 From: Hayden Briese Date: Sun, 1 Oct 2023 23:17:49 +1100 Subject: [PATCH] Remove name field from error feedback form --- .../components/ErrorBoundary/ErrorBoundary.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/components/ErrorBoundary/ErrorBoundary.tsx b/app/src/components/ErrorBoundary/ErrorBoundary.tsx index b7cc7d1c2..ffa04c108 100644 --- a/app/src/components/ErrorBoundary/ErrorBoundary.tsx +++ b/app/src/components/ErrorBoundary/ErrorBoundary.tsx @@ -14,7 +14,6 @@ import { MinimalErrorBoundary } from './MinimalErrorBoundary'; import { ReactNode } from 'react'; interface Inputs { - name?: string; email?: string; comments?: string; } @@ -30,7 +29,7 @@ export const ErrorBoundary = ({ children }: ErrorBoundaryProps) => { return ( ( + fallback={({ eventId, error, resetError, componentStack }) => ( { {`If you'd like to help, tell us what happened`} - - { { - if (name || email || comments) { + onPress={handleSubmit(({ email, comments }) => { + if (email || comments) { Sentry.captureUserFeedback({ event_id: eventId || - Sentry.captureException(error, { extra: { errorBoundary: true } }), - name: name ?? '', + Sentry.captureException(error, { + extra: { errorBoundary: true, componentStack }, + }), + name: '', email: email, comments: comments ?? '', });