Skip to content

Commit

Permalink
Add appName only when defined
Browse files Browse the repository at this point in the history
  • Loading branch information
wjames111 committed Sep 20, 2024
1 parent f2f4039 commit a1cecb6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/Tool/FixPhoneNumbers/FixPhoneNumbers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ const FixPhoneNumbers: React.FC<Props> = ({
const { classes } = useStyles();
const { enqueueSnackbar } = useSnackbar();
const { appName } = useGetAppSettings();
const [defaultSource, setDefaultSource] = useState<string | undefined>(
appName || 'MPDX',
);
const [defaultSource, setDefaultSource] = useState<string>(appName || 'MPDX');

const [updateInvalidPhoneNumbers] = useUpdateInvalidPhoneNumbersMutation();
const { data } = useGetInvalidPhoneNumbersQuery({
Expand All @@ -135,8 +133,11 @@ const FixPhoneNumbers: React.FC<Props> = ({

// Create a mutable copy of the query data and store in the state
useEffect(() => {
const existingSources = new Set<string | undefined>();
existingSources.add(appName);
const existingSources = new Set<string>();

if (appName) {
existingSources.add(appName);

Check warning on line 139 in src/components/Tool/FixPhoneNumbers/FixPhoneNumbers.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/Tool/FixPhoneNumbers/FixPhoneNumbers.tsx#L139

Added line #L139 was not covered by tests
}

const newDataState = data
? data.people.nodes?.reduce(
Expand Down

0 comments on commit a1cecb6

Please sign in to comment.