From 5c741e3d9884921ecd9e14da8db5906584d9102d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 20 May 2022 18:58:23 +0100 Subject: [PATCH] fix: Crash render timestamp on some languages --- app/components/LocaleTime.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/LocaleTime.tsx b/app/components/LocaleTime.tsx index ee2b75739..5b09f3c50 100644 --- a/app/components/LocaleTime.tsx +++ b/app/components/LocaleTime.tsx @@ -43,7 +43,7 @@ const LocaleTime: React.FC = ({ en_US: "MMMM do, yyyy h:mm a", fr_FR: "'Le 'd MMMM yyyy 'à' H:mm", }; - const formatLocaleLong = dateFormatLong[userLocale]; + const formatLocaleLong = dateFormatLong[userLocale] ?? "MMMM do, yyyy h:mm a"; const formatLocale = format ? format[userLocale] : formatLocaleLong; const [_, setMinutesMounted] = React.useState(0); // eslint-disable-line @typescript-eslint/no-unused-vars const callback = React.useRef<() => void>();