From 1feffe43265b1a3d46b70ee72330b6ae04818f8a Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 14 Oct 2023 14:59:59 +0200 Subject: [PATCH] Ignore hashtag history if undefined --- app/javascript/flavours/glitch/components/hashtag.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/flavours/glitch/components/hashtag.jsx b/app/javascript/flavours/glitch/components/hashtag.jsx index 9821cf185..7e87440c6 100644 --- a/app/javascript/flavours/glitch/components/hashtag.jsx +++ b/app/javascript/flavours/glitch/components/hashtag.jsx @@ -63,7 +63,7 @@ export const ImmutableHashtag = ({ hashtag }) => ( to={`/tags/${hashtag.get('name')}`} people={hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1} // @ts-expect-error - history={hashtag.get('history').reverse().map((day) => day.get('uses')).toArray()} + history={hashtag.get('history')?.reverse().map((day) => day.get('uses')).toArray()} /> ); @@ -82,7 +82,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className, description {description ? ( {description} ) : ( - typeof people !== 'undefined' ? : + !isNaN(people) && (typeof people !== 'undefined' ? : ) )} @@ -92,7 +92,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className, description )} - {withGraph && ( + {withGraph && typeof history !== 'undefined' && (
0)}>