summaryrefslogtreecommitdiffstats
path: root/web/react/components/create_post.jsx
diff options
context:
space:
mode:
authornickago <ngonella@calpoly.edu>2015-07-20 12:54:13 -0700
committernickago <ngonella@calpoly.edu>2015-07-22 08:48:37 -0700
commitee25df7e5545ad3f4d6817b967a0bcea6e6e398d (patch)
treec742bc7150810f907d5d029ada5dce33a5a8d886 /web/react/components/create_post.jsx
parent06bac01e882a7b05519d0e39bccafacd0c27c602 (diff)
downloadchat-ee25df7e5545ad3f4d6817b967a0bcea6e6e398d.tar.gz
chat-ee25df7e5545ad3f4d6817b967a0bcea6e6e398d.tar.bz2
chat-ee25df7e5545ad3f4d6817b967a0bcea6e6e398d.zip
Added message persistance on closing RHS/switching to another comment
thread. Similar to the center pane and channels, switching comment threads won't delete entered but unsent text/media in the RHS
Diffstat (limited to 'web/react/components/create_post.jsx')
-rw-r--r--web/react/components/create_post.jsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/web/react/components/create_post.jsx b/web/react/components/create_post.jsx
index d38a6798f..15ff9f6cf 100644
--- a/web/react/components/create_post.jsx
+++ b/web/react/components/create_post.jsx
@@ -50,7 +50,7 @@ module.exports = React.createClass({
post.message,
false,
function(data) {
- PostStore.storeDraft(data.channel_id, user_id, null);
+ PostStore.storeDraft(data.channel_id, null);
this.setState({ messageText: '', submitting: false, post_error: null, previews: [], server_error: null, limit_error: null });
if (data.goto_location.length > 0) {
@@ -70,7 +70,7 @@ module.exports = React.createClass({
client.createPost(post, ChannelStore.getCurrent(),
function(data) {
- PostStore.storeDraft(data.channel_id, data.user_id, null);
+ PostStore.storeDraft(data.channel_id, null);
this.setState({ messageText: '', submitting: false, post_error: null, previews: [], server_error: null, limit_error: null });
this.resizePostHolder();
AsyncClient.getPosts(true);
@@ -127,7 +127,7 @@ module.exports = React.createClass({
$(window).trigger('resize');
},
handleFileUpload: function(newPreviews, channel_id) {
- var draft = PostStore.getDraft(channel_id, UserStore.getCurrentId());
+ var draft = PostStore.getDraft(channel_id);
if (!draft) {
draft = {}
draft['message'] = '';
@@ -148,7 +148,7 @@ module.exports = React.createClass({
} else {
draft['previews'] = draft['previews'].concat(newPreviews);
draft['uploadsInProgress'] = draft['uploadsInProgress'] > 0 ? draft['uploadsInProgress'] - 1 : 0;
- PostStore.storeDraft(channel_id, UserStore.getCurrentId(), draft);
+ PostStore.storeDraft(channel_id, draft);
}
},
handleUploadError: function(err) {