From 4148ee93e5ff127676a90b7755ae0cc8a29ccec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 28 Nov 2018 16:31:48 +0100 Subject: [PATCH] MM-12960: Only back to previous channel if is not archived (#2389) --- app/actions/views/channel.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/actions/views/channel.js b/app/actions/views/channel.js index 0731f1bbd..12949ef87 100644 --- a/app/actions/views/channel.js +++ b/app/actions/views/channel.js @@ -20,7 +20,6 @@ import {getProfilesInChannel} from 'mattermost-redux/actions/users'; import {General, Preferences} from 'mattermost-redux/constants'; import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; import {getTeamByName} from 'mattermost-redux/selectors/entities/teams'; -import {getConfig} from 'mattermost-redux/selectors/entities/general'; import { getChannelByName, @@ -283,7 +282,6 @@ export function selectPenultimateChannel(teamId) { const {channels, myMembers} = state.entities.channels; const {currentUserId} = state.entities.users; const {myPreferences} = state.entities.preferences; - const viewArchivedChannels = getConfig(state).ExperimentalViewArchivedChannels === 'true'; const lastChannelForTeam = state.views.team.lastChannelForTeam[teamId]; const lastChannelId = lastChannelForTeam && lastChannelForTeam.length > 1 ? lastChannelForTeam[1] : ''; const lastChannel = channels[lastChannelId]; @@ -297,7 +295,7 @@ export function selectPenultimateChannel(teamId) { if ( myMembers[lastChannelId] && lastChannel && - (lastChannel.delete_at === 0 || viewArchivedChannels) && + lastChannel.delete_at === 0 && (lastChannel.team_id === teamId || isDMVisible || isGMVisible) ) { dispatch(setChannelLoading(true));