Code review suggestions.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -46,7 +46,7 @@ export default class DocPreview extends React.PureComponent {
|
||||
<SendMessage
|
||||
noInput={true}
|
||||
tinode={this.props.tinode}
|
||||
viewportWidth={this.props.viewportWidth}
|
||||
viewportWidth={this.props.viewportWidth} // Used by `formatter`.
|
||||
replyTo={this.props.replyTo}
|
||||
formatter={this.props.formatter}
|
||||
onCancelReply={this.props.onCancelReply}
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class ImagePreview extends React.PureComponent {
|
||||
messagePrompt="add_image_caption"
|
||||
acceptBlank={true}
|
||||
tinode={this.props.tinode}
|
||||
viewportWidth={this.props.viewportWidth}
|
||||
viewportWidth={this.props.viewportWidth} // Used by `formatter`.
|
||||
replyTo={this.props.replyTo}
|
||||
formatter={this.props.formatter}
|
||||
onCancelReply={this.props.onCancelReply}
|
||||
|
||||
Reference in New Issue
Block a user