More code review suggestions.

This commit is contained in:
aforge
2021-09-25 20:33:26 +03:00
parent b1589a8790
commit b6abc76f3f
7 changed files with 23 additions and 39 deletions
+5 -4
View File
@@ -843,16 +843,17 @@ class MessagesView extends React.Component {
uploader.cancel();
}
handlePickReply(seq, content, senderId, senderName) {
handlePickReply(seq, content, forwarded, senderId, senderName) {
this.setState({reply: null});
if (!seq || !content) {
return;
}
if (typeof content == 'string') {
content = Drafty.init(content);
}
content = forwarded ?
Drafty.forwardedContent(content) :
typeof content == 'string' ?
Drafty.init(content) : content;
if (Drafty.isValid(content)) {
content = Drafty.preview(content, QUOTED_REPLY_LENGTH);
} else {
+6 -2
View File
@@ -1450,8 +1450,12 @@ class TinodeWeb extends React.Component {
// If the Find panel is active, close it.
this.handleSidepanelCancel();
}
const header = params.userName;
const content = typeof params.content == 'string' ? Tinode.Drafty.init(params.content) : params.content;
const header = '➦ ' + params.userName;
const content = params.forwarded ?
Tinode.Drafty.forwardedContent(params.content) :
typeof params.content == 'string' ?
Tinode.Drafty.init(params.content) : params.content;
//const content = typeof params.content == 'string' ? Tinode.Drafty.init(params.content) : params.content;
const preview = Tinode.Drafty.preview(content, 30);
const msg = Tinode.Drafty.append(
Tinode.Drafty.appendLineBreak(