Ignore hashtag history if undefined
This commit is contained in:
parent
aa27eaece4
commit
1feffe4326
1 changed files with 3 additions and 3 deletions
|
@ -63,7 +63,7 @@ export const ImmutableHashtag = ({ hashtag }) => (
|
||||||
to={`/tags/${hashtag.get('name')}`}
|
to={`/tags/${hashtag.get('name')}`}
|
||||||
people={hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1}
|
people={hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1}
|
||||||
// @ts-expect-error
|
// @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 ? (
|
||||||
<span>{description}</span>
|
<span>{description}</span>
|
||||||
) : (
|
) : (
|
||||||
typeof people !== 'undefined' ? <ShortNumber value={people} renderer={accountsCountRenderer} /> : <Skeleton width={100} />
|
!isNaN(people) && (typeof people !== 'undefined' ? <ShortNumber value={people} renderer={accountsCountRenderer} /> : <Skeleton width={100} />)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ const Hashtag = ({ name, href, to, people, uses, history, className, description
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{withGraph && (
|
{withGraph && typeof history !== 'undefined' && (
|
||||||
<div className='trends__item__sparkline'>
|
<div className='trends__item__sparkline'>
|
||||||
<SilentErrorBoundary>
|
<SilentErrorBoundary>
|
||||||
<Sparklines width={50} height={28} data={history ? history : Array.from(Array(7)).map(() => 0)}>
|
<Sparklines width={50} height={28} data={history ? history : Array.from(Array(7)).map(() => 0)}>
|
||||||
|
|
Loading…
Reference in a new issue