summaryrefslogtreecommitdiffstats
path: root/webapp/actions/global_actions.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions/global_actions.jsx')
-rw-r--r--webapp/actions/global_actions.jsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx
index 3c88a7013..a1b178d67 100644
--- a/webapp/actions/global_actions.jsx
+++ b/webapp/actions/global_actions.jsx
@@ -36,7 +36,7 @@ import store from 'stores/redux_store.jsx';
const dispatch = store.dispatch;
const getState = store.getState;
import {removeUserFromTeam} from 'mattermost-redux/actions/teams';
-import {viewChannel, getChannelStats, getMyChannelMember} from 'mattermost-redux/actions/channels';
+import {viewChannel, getChannelStats, getMyChannelMember, getChannelAndMyMember} from 'mattermost-redux/actions/channels';
export function emitChannelClickEvent(channel) {
function userVisitedFakeChannel(chan, success, fail) {
@@ -557,13 +557,13 @@ export function redirectUserToDefaultTeam() {
redirect(teams[teamId].name, channel);
} else if (channelId) {
Client.setTeamId(teamId);
- Client.getChannel(
- channelId,
+ getChannelAndMyMember(channelId)(dispatch, getState).then(
(data) => {
- redirect(teams[teamId].name, data.channel.name);
- },
- () => {
- redirect(teams[teamId].name, 'town-square');
+ if (data) {
+ redirect(teams[teamId].name, data.channel.name);
+ } else {
+ redirect(teams[teamId].name, 'town-square');
+ }
}
);
} else {