Skip to content

Commit

Permalink
Revert changes to add-form component.
Browse files Browse the repository at this point in the history
  • Loading branch information
allilevine committed Jan 21, 2025
1 parent 8f41011 commit 29e312a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/subscriber/src/components/add-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ interface Props {
recordTracksEvent?: RecordTrackEvents;
onSkipBtnClick?: () => void;
onImportStarted?: ( hasFile: boolean ) => void;
onImportFinished?: ( completedJob?: CompletedImportJob ) => void;
onImportFinished?: () => void;
onChangeIsImportValid?: ( isValid: boolean ) => void;
titleText?: string;
subtitleText?: string;
Expand All @@ -54,8 +54,6 @@ interface Props {
disabled?: boolean;
}

type CompletedImportJob = Subscriber.CompletedImportJob;

export const AddSubscriberForm: FunctionComponent< Props > = ( props ) => {
const { __ } = useI18n();
const HANDLED_ERROR = {
Expand Down Expand Up @@ -133,8 +131,6 @@ export const AddSubscriberForm: FunctionComponent< Props > = ( props ) => {
} )
);

const { completedJob } = useActiveJobRecognition( siteId );

const getValidEmails = useCallback( () => {
return isValidEmails.map( ( x, i ) => x && emails[ i ] ).filter( ( x ) => !! x ) as string[];
}, [ isValidEmails, emails ] );
Expand Down Expand Up @@ -290,11 +286,7 @@ export const AddSubscriberForm: FunctionComponent< Props > = ( props ) => {
function importFinishedRecognition() {
if ( ! importSelector?.error && prevInProgress.current && ! inProgress ) {
resetFormState();
if ( completedJob ) {
onImportFinished?.( completedJob );
} else {
onImportFinished?.();
}
onImportFinished?.();
}
}

Expand Down

0 comments on commit 29e312a

Please sign in to comment.