From ee25df7e5545ad3f4d6817b967a0bcea6e6e398d Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Mon, 20 Jul 2015 12:54:13 -0700
Subject: 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

---
 web/react/components/create_post.jsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'web/react/components/create_post.jsx')

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) {
-- 
cgit v1.2.3-1-g7c22

