From 4aa96c76b4662d6d7f9a28af0b719404c31bbb45 Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Thu, 20 Oct 2016 11:32:20 -0400
Subject: Fix autocomplete for old mechanisms and add partial fix for channel
 switcher (#4279)

---
 webapp/actions/channel_actions.jsx | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

(limited to 'webapp/actions/channel_actions.jsx')

diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx
index 8364fe9b6..61c839652 100644
--- a/webapp/actions/channel_actions.jsx
+++ b/webapp/actions/channel_actions.jsx
@@ -118,7 +118,7 @@ export function removeUserFromChannel(channelId, userId, success, error) {
 
 export function openDirectChannelToUser(user, success, error) {
     const channelName = Utils.getDirectChannelName(UserStore.getCurrentId(), user.id);
-    let channel = ChannelStore.getByName(channelName);
+    const channel = ChannelStore.getByName(channelName);
 
     if (channel) {
         PreferenceStore.setPreference(Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, user.id, 'true');
@@ -137,16 +137,6 @@ export function openDirectChannelToUser(user, success, error) {
         return;
     }
 
-    channel = {
-        name: channelName,
-        last_post_at: 0,
-        total_msg_count: 0,
-        type: 'D',
-        display_name: user.username,
-        teammate_id: user.id,
-        status: UserStore.getStatus(user.id)
-    };
-
     Client.createDirectChannel(
         user.id,
         (data) => {
-- 
cgit v1.2.3-1-g7c22

