MM-12960: Only back to previous channel if is not archived (#2389)
This commit is contained in:
parent
52109fd132
commit
a9ebf5dcfa
1 changed files with 1 additions and 3 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue