Skip to content

Commit

Permalink
Remove name field from error feedback form
Browse files Browse the repository at this point in the history
  • Loading branch information
hbriese committed Oct 1, 2023
1 parent 669ed07 commit 393339c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions app/src/components/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { MinimalErrorBoundary } from './MinimalErrorBoundary';
import { ReactNode } from 'react';

interface Inputs {
name?: string;
email?: string;
comments?: string;
}
Expand All @@ -30,7 +29,7 @@ export const ErrorBoundary = ({ children }: ErrorBoundaryProps) => {

return (
<MinimalErrorBoundary
fallback={({ eventId, error, resetError }) => (
fallback={({ eventId, error, resetError, componentStack }) => (
<Screen>
<Appbar
mode="small"
Expand All @@ -52,8 +51,6 @@ export const ErrorBoundary = ({ children }: ErrorBoundaryProps) => {
<View style={styles.form}>
<Text>{`If you'd like to help, tell us what happened`}</Text>

<FormTextField label="Name" control={control} name="name" />

<FormTextField label="Email" control={control} name="email" />

<FormTextField
Expand All @@ -69,13 +66,15 @@ export const ErrorBoundary = ({ children }: ErrorBoundaryProps) => {
<FormSubmitButton
mode="contained"
control={control}
onPress={handleSubmit(({ name, email, comments }) => {
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 ?? '',
});
Expand Down

0 comments on commit 393339c

Please sign in to comment.