diff options
author | Vitaly Takmazov | 2019-06-15 17:06:03 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:55 +0300 |
commit | 65416adc62234d8c6426d13703f0c073be072b65 (patch) | |
tree | 16dcdb40480dbfe57946e0aed0ec98736fedd1ca | |
parent | dda22de10cee8283998073c64dd54de948d22ed2 (diff) |
Comment: do not show empty body
-rw-r--r-- | vnext/src/ui/Thread.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/vnext/src/ui/Thread.js b/vnext/src/ui/Thread.js index cc0dbac2..50155f8c 100644 --- a/vnext/src/ui/Thread.js +++ b/vnext/src/ui/Thread.js @@ -78,15 +78,14 @@ function Comment({ msg, draft, visitor, active, setActive, onStartEditing, postC } </div> </div> - <div style={bubbleStyle(visitor, msg)}> - { - msg.html ? <div dangerouslySetInnerHTML={{ __html: msg.body }} ref={msgRef} /> - : - <div ref={msgRef}> - <p dangerouslySetInnerHTML={{ __html: format(msg.body, msg.mid, (msg.tags || []).indexOf('code') >= 0) }} /> - </div> - } - </div> + { + msg.body && + <div style={bubbleStyle(visitor, msg)}> + <div ref={msgRef}> + <p dangerouslySetInnerHTML={{ __html: format(msg.body, msg.mid, (msg.tags || []).indexOf('code') >= 0) }} /> + </div> + </div> + } { msg.photo && <div className="msg-media"> @@ -96,9 +95,9 @@ function Comment({ msg, draft, visitor, active, setActive, onStartEditing, postC </div> } <div className="embedContainer" ref={embedRef} /> - { - active === msg.rid && <MessageInput data={msg} text={draft || ''} onSend={postComment}>Write a comment...</MessageInput> - } + { + active === msg.rid && <MessageInput data={msg} text={draft || ''} onSend={postComment}>Write a comment...</MessageInput> + } </div> ); } |