Skip to content

Commit

Permalink
Initialize route ID to undefined, not ''
Browse files Browse the repository at this point in the history
  • Loading branch information
danetsao committed Apr 30, 2024
1 parent 3689236 commit 75654d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/CurrentAssignmentView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const CurrentAssignmentView: FunctionComponent<
const history = useHistory();
const currentRouteId = useRouteMatch<{ servicePointId: string }>(
'/settings/calendar/active/:servicePointId'
)?.params?.servicePointId ?? '';
)?.params?.servicePointId;

if (!dataRepository.isLoaded()) {
return (
Expand Down Expand Up @@ -93,7 +93,7 @@ export const CurrentAssignmentView: FunctionComponent<
};
});

const calendarName = dataRepository.getCalendars().filter((c) => c.assignments.includes(currentRouteId))[0]?.name ?? '';
const calendarName = dataRepository.getCalendars().filter((c) => c.assignments.includes(currentRouteId ?? ''))[0]?.name ?? '';

const pageTitle = intl.formatMessage({ id: 'ui-calendar.meta.titleSettings' }) + ' - ' + intl.formatMessage({
id: 'ui-calendar.currentAssignmentView.title'
Expand Down

0 comments on commit 75654d8

Please sign in to comment.