mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-16 15:21:48 +03:00
Fix history key might be undefined in hashtag object
And some other fixes
This commit is contained in:
parent
2ad72a667d
commit
810596b7cf
1 changed files with 5 additions and 5 deletions
|
@ -253,21 +253,21 @@ function Search(props) {
|
|||
<ul class="link-list hashtag-list">
|
||||
{hashtagResults.map((hashtag) => {
|
||||
const { name, history } = hashtag;
|
||||
const total = history.reduce(
|
||||
const total = history?.reduce?.(
|
||||
(acc, cur) => acc + +cur.uses,
|
||||
0,
|
||||
);
|
||||
return (
|
||||
<li key={hashtag.name}>
|
||||
<li key={`${name}-${total}`}>
|
||||
<Link
|
||||
to={
|
||||
instance
|
||||
? `/${instance}/t/${hashtag.name}`
|
||||
: `/t/${hashtag.name}`
|
||||
? `/${instance}/t/${name}`
|
||||
: `/t/${name}`
|
||||
}
|
||||
>
|
||||
<Icon icon="hashtag" />
|
||||
<span>{hashtag.name}</span>
|
||||
<span>{name}</span>
|
||||
{!!total && (
|
||||
<span class="count">
|
||||
{shortenNumber(total)}
|
||||
|
|
Loading…
Add table
Reference in a new issue