summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-16 16:58:05 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-21 11:56:27 -0400
commit5b917dd4a6fc4259cd17ad0b2e106f3b71254ef2 (patch)
treecb80514e0a8cdc8ab740ba81962e7df339d6055a /web/react
parent644c78755cb7cf8ef818106b9629df1018d0d736 (diff)
downloadchat-5b917dd4a6fc4259cd17ad0b2e106f3b71254ef2.tar.gz
chat-5b917dd4a6fc4259cd17ad0b2e106f3b71254ef2.tar.bz2
chat-5b917dd4a6fc4259cd17ad0b2e106f3b71254ef2.zip
Trim the carets from the beginning of reply messages when they're posted
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/create_post.jsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index 7bc5e2481..a3e354599 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -71,6 +71,11 @@ module.exports = React.createClass({
post.root_id = this.state.rootId;
post.parent_id = this.state.parentId;
+ // if this is a reply, trim off any carets from the beginning of a message
+ if (post.root_id && post.message.startsWith("^")) {
+ post.message = post.message.replace(/^\^+\s*/g, "");
+ }
+
client.createPost(post, ChannelStore.getCurrent(),
function(data) {
PostStore.storeDraft(data.channel_id, data.user_id, null);