Merge branch 'defensive-emoji-modal' into 'develop'

ReactionsModal: defensive property checks

See merge request soapbox-pub/soapbox-fe!1069
purgecss
Alex Gleason 2022-03-03 17:52:16 +00:00
commit 3192120211
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -93,8 +93,8 @@ class ReactionsModal extends React.PureComponent {
const { reaction } = this.state;
const accounts = reactions && (reaction
? reactions.find(reaction => reaction.name === this.state.reaction).accounts.map(account => ({ id: account, reaction: this.state.reaction }))
: reactions.map(reaction => reaction.accounts.map(account => ({ id: account, reaction: reaction.name }))).flatten());
? reactions.find(reaction => reaction.name === this.state.reaction)?.accounts.map(account => ({ id: account, reaction: this.state.reaction }))
: reactions.map(reaction => reaction?.accounts.map(account => ({ id: account, reaction: reaction.name }))).flatten());
let body;