summaryrefslogtreecommitdiffstats
path: root/webapp/components/create_post.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-05-30 07:00:20 -0700
committerHarrison Healey <harrisonmhealey@gmail.com>2016-05-30 10:00:20 -0400
commit6c86ec3e4cc8137116d09e9db583b43fff659d30 (patch)
tree0eb56439d7d441f55fef991cf79a8a89abb17cf8 /webapp/components/create_post.jsx
parent0dfac9875ef6f5f20318a3ef542b11592da8480e (diff)
downloadchat-6c86ec3e4cc8137116d09e9db583b43fff659d30.tar.gz
chat-6c86ec3e4cc8137116d09e9db583b43fff659d30.tar.bz2
chat-6c86ec3e4cc8137116d09e9db583b43fff659d30.zip
changed behaviour on non-empty post/comment (#3154)
Added preventDefault changed behaviour on non-empty post/comment
Diffstat (limited to 'webapp/components/create_post.jsx')
-rw-r--r--webapp/components/create_post.jsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/webapp/components/create_post.jsx b/webapp/components/create_post.jsx
index 75c75f09d..cdcaacbf3 100644
--- a/webapp/components/create_post.jsx
+++ b/webapp/components/create_post.jsx
@@ -374,12 +374,12 @@ class CreatePost extends React.Component {
}
if ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && e.keyCode === KeyCodes.UP) {
- e.preventDefault();
const channelId = ChannelStore.getCurrentId();
const lastPost = PostStore.getCurrentUsersLatestPost(channelId);
- if (!lastPost) {
+ if (!lastPost || this.state.messageText !== '') {
return;
}
+ e.preventDefault();
let message = lastPost.message;
if (this.state.lastMessage !== '') {
message = this.state.lastMessage;