Skip to content

Commit

Permalink
Changed conditional logic of '??' for null coalescence over '||'
Browse files Browse the repository at this point in the history
  • Loading branch information
danetsao committed Nov 6, 2023
1 parent 79d1e80 commit 9d87b38
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 @@ -34,7 +34,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 @@ -92,7 +92,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 9d87b38

Please sign in to comment.