fix: relpy markdown message
This commit is contained in:
@@ -72,6 +72,9 @@ const renderContent = (data) => {
|
||||
case ContentTypes.text:
|
||||
res = <span className="txt"> {content}</span>;
|
||||
break;
|
||||
case ContentTypes.markdown:
|
||||
res = <span className="txt">[markdown]</span>;
|
||||
break;
|
||||
case ContentTypes.image:
|
||||
case ContentTypes.imageJPG:
|
||||
res = <img className="pic" src={thumbnail} />;
|
||||
|
||||
@@ -69,6 +69,9 @@ const renderContent = (data) => {
|
||||
case ContentTypes.text:
|
||||
res = content;
|
||||
break;
|
||||
case ContentTypes.markdown:
|
||||
res = `[markdown]`;
|
||||
break;
|
||||
case ContentTypes.image:
|
||||
case ContentTypes.imageJPG:
|
||||
res = <img className="pic" src={pictureIcon} />;
|
||||
|
||||
@@ -96,14 +96,27 @@ function Send({
|
||||
}
|
||||
}
|
||||
};
|
||||
const sendMarkdown = (content) => {
|
||||
sendMessage({
|
||||
id,
|
||||
type: "markdown",
|
||||
content,
|
||||
from_uid,
|
||||
properties: { local_id: new Date().getTime() },
|
||||
});
|
||||
const sendMarkdown = async (content) => {
|
||||
if (replying_mid) {
|
||||
console.log("replying", replying_mid);
|
||||
await replyMessage({
|
||||
id,
|
||||
reply_mid: replying_mid,
|
||||
type: "markdown",
|
||||
content,
|
||||
context,
|
||||
from_uid,
|
||||
});
|
||||
dispatch(removeReplyingMessage(id));
|
||||
} else {
|
||||
sendMessage({
|
||||
id,
|
||||
type: "markdown",
|
||||
content,
|
||||
from_uid,
|
||||
properties: { local_id: new Date().getTime() },
|
||||
});
|
||||
}
|
||||
};
|
||||
const toggleMode = () => {
|
||||
dispatch(updateInputMode(mode == Modes.text ? Modes.markdown : Modes.text));
|
||||
|
||||
Reference in New Issue
Block a user