Skip to content

Commit f501da9

Browse files
committed
flow
1 parent 74a762a commit f501da9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/components/LocaleTime.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type Props = {
3838
shorten?: boolean,
3939
};
4040

41-
function Time({ addSuffix, children, dateTime, shorten, tooltipDelay }: Props) {
41+
function LocaleTime({ addSuffix, children, dateTime, shorten, tooltipDelay }: Props) {
4242
const userLocale = useUserLocale();
4343
const [_, setMinutesMounted] = React.useState(0); // eslint-disable-line no-unused-vars
4444
const callback = React.useRef();
@@ -57,7 +57,7 @@ function Time({ addSuffix, children, dateTime, shorten, tooltipDelay }: Props) {
5757

5858
let content = distanceInWordsToNow(dateTime, {
5959
addSuffix,
60-
locale: locales[userLocale],
60+
locale: userLocale ? locales[userLocale] : undefined,
6161
});
6262

6363
if (shorten) {
@@ -78,4 +78,4 @@ function Time({ addSuffix, children, dateTime, shorten, tooltipDelay }: Props) {
7878
);
7979
}
8080

81-
export default Time;
81+
export default LocaleTime;

0 commit comments

Comments
 (0)