UNPKG

mattermost-redux

Version:

Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client

16 lines (15 loc) 940 B
"use strict"; // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.selectShowChannelBanner = void 0; const channels_1 = require("@mattermost/types/channels"); const constants_1 = require("mattermost-redux/constants"); const channels_2 = require("mattermost-redux/selectors/entities/channels"); const selectShowChannelBanner = (state, channelId) => { const channelBannerInfo = (0, channels_2.getChannelBanner)(state, channelId); const channel = (0, channels_2.getChannel)(state, channelId); const isValidChannelType = Boolean(channel && (channel.type === constants_1.General.OPEN_CHANNEL || channel.type === constants_1.General.PRIVATE_CHANNEL)); return isValidChannelType && (0, channels_1.channelBannerEnabled)(channelBannerInfo); }; exports.selectShowChannelBanner = selectShowChannelBanner;