app/javascript/mastodon/components/hashtag.js: Do not crash when hashtag.history is undefined

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-06-23 16:42:30 +02:00
parent 6b3614ae4c
commit 1af76fae0e
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ const Hashtag = ({ hashtag }) => (
</div>
<div className='trends__item__sparkline'>
<Sparklines width={50} height={28} data={hashtag.get('history').reverse().map(day => day.get('uses')).toArray()}>
<Sparklines width={50} height={28} data={hashtag.get('history') && hashtag.get('history').reverse().map(day => day.get('uses')).toArray()}>
<SparklinesCurve style={{ fill: 'none' }} />
</Sparklines>
</div>

View file

@ -20,7 +20,7 @@ const Hashtag = ({ hashtag }) => (
</div>
<div className='trends__item__sparkline'>
<Sparklines width={50} height={28} data={hashtag.get('history').reverse().map(day => day.get('uses')).toArray()}>
<Sparklines width={50} height={28} data={hashtag.get('history') && hashtag.get('history').reverse().map(day => day.get('uses')).toArray()}>
<SparklinesCurve style={{ fill: 'none' }} />
</Sparklines>
</div>