Code review suggestions.

This commit is contained in:
aforge
2021-09-01 17:07:18 +03:00
parent c408cc12c8
commit 21d3115346
5 changed files with 104 additions and 73 deletions
+5 -2
View File
@@ -62,7 +62,8 @@ class BaseChatMessage extends React.PureComponent {
e.preventDefault();
e.stopPropagation();
const menuItems = this.props.received == Tinode.MESSAGE_STATUS_FAILED ? ['menu_item_send_retry'] : [];
if (this.props.received >= Tinode.MESSAGE_STATUS_FAILED &&
if (this.props.userIsWriter &&
this.props.received > Tinode.MESSAGE_STATUS_FAILED &&
this.props.received < Tinode.MESSAGE_STATUS_DEL_RANGE) {
menuItems.push('menu_item_reply');
}
@@ -82,7 +83,9 @@ class BaseChatMessage extends React.PureComponent {
e.preventDefault();
e.stopPropagation();
const replyToSeq = this.props.replyToSeq;
this.props.onQuoteClick(replyToSeq);
if (replyToSeq) {
this.props.onQuoteClick(replyToSeq);
}
}
render() {