From 9e8cd937908d5d2e730e94f761d6533eb2d95e28 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Wed, 18 Nov 2015 17:29:06 -0500
Subject: Implementing Permalinks and jumping to post from search. Performance
 improvements.

---
 web/react/pages/channel.jsx | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

(limited to 'web/react/pages/channel.jsx')

diff --git a/web/react/pages/channel.jsx b/web/react/pages/channel.jsx
index 126942e65..5cc1be741 100644
--- a/web/react/pages/channel.jsx
+++ b/web/react/pages/channel.jsx
@@ -1,7 +1,6 @@
 // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
 // See License.txt for license information.
 
-import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
 import ChannelView from '../components/channel_view.jsx';
 import ChannelLoader from '../components/channel_loader.jsx';
 import ErrorBar from '../components/error_bar.jsx';
@@ -23,15 +22,14 @@ import ImportThemeModal from '../components/user_settings/import_theme_modal.jsx
 import InviteMemberModal from '../components/invite_member_modal.jsx';
 
 import * as AsyncClient from '../utils/async_client.jsx';
-import Constants from '../utils/constants.jsx';
-var ActionTypes = Constants.ActionTypes;
-
-function setupChannelPage(props) {
-    AppDispatcher.handleViewAction({
-        type: ActionTypes.CLICK_CHANNEL,
-        name: props.ChannelName,
-        id: props.ChannelId
-    });
+import * as EventHelpers from '../dispatcher/event_helpers.jsx';
+
+function setupChannelPage(props, team, channel) {
+    if (props.PostId === '') {
+        EventHelpers.emitChannelClickEvent(channel);
+    } else {
+        EventHelpers.emitPostFocusEvent(props.PostId);
+    }
 
     AsyncClient.getAllPreferences();
 
-- 
cgit v1.2.3-1-g7c22

