diff --git a/web/components/Account/Info/InfoCompanyApplications.tsx b/web/components/Account/Info/InfoCompanyApplications.tsx index f22782c0..30654816 100644 --- a/web/components/Account/Info/InfoCompanyApplications.tsx +++ b/web/components/Account/Info/InfoCompanyApplications.tsx @@ -13,6 +13,7 @@ interface Props { const InfoCompanyApplications = ({ user }: Props) => { const { t } = useTranslation('account') const { currentCampaign } = useCampaignContext() + if (!currentCampaign) return null return ( diff --git a/web/utils/date.ts b/web/utils/date.ts index a2caa592..49eb48a6 100644 --- a/web/utils/date.ts +++ b/web/utils/date.ts @@ -4,10 +4,13 @@ import DateFnsFormat from 'date-fns/format' export const format = ( date: string | Date, formatDate: string = 'dd/MM/yyyy', -) => - DateFnsFormat(new Date(date), formatDate, { - locale: fr, - }) +) => { + if (date) { + return DateFnsFormat(new Date(date), formatDate, { + locale: fr, + }) + } +} export const orderByDate = (array: Record[], key: string) => { if (!array) return []