Skip to content

Commit

Permalink
Merge branch 'MuxiKeStack:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
eleliauk authored Sep 12, 2024
2 parents b50aadc + 3df24b9 commit 2e43fd1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/modules/notification/components/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,21 @@ const Notification: React.FC = memo(() => {
};

if (tab === '提问') {
const comments = res.data
.filter((item) => item.type === 'Comment')
.map((item) => JSON.parse(item.content));
const comments = Array.isArray(res.data)
? res.data
.filter((item) => item.type === 'Comment')
.map((item) => JSON.parse(item.content))
: [];
setCommentMessage([
...commentMessage,
...(await personalItems(comments, 'Comment')),
]);
} else if (tab === '点赞') {
const supports = res.data
.filter((item) => item.type === 'Support')
.map((item) => JSON.parse(item.content));
const supports = Array.isArray(res.data)
? res.data
.filter((item) => item.type === 'Support')
.map((item) => JSON.parse(item.content))
: [];
setSupportMessage([
...supportMessage,
...(await personalItems(supports, 'Support')),
Expand Down

0 comments on commit 2e43fd1

Please sign in to comment.