ReactionsModal: defensive property checks
This commit is contained in:
parent
7d0bf5e5e6
commit
9b756043fb
|
@ -93,8 +93,8 @@ class ReactionsModal extends React.PureComponent {
|
||||||
const { reaction } = this.state;
|
const { reaction } = this.state;
|
||||||
|
|
||||||
const accounts = reactions && (reaction
|
const accounts = reactions && (reaction
|
||||||
? reactions.find(reaction => reaction.name === this.state.reaction).accounts.map(account => ({ id: account, reaction: this.state.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.map(reaction => reaction?.accounts.map(account => ({ id: account, reaction: reaction.name }))).flatten());
|
||||||
|
|
||||||
let body;
|
let body;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue