UNPKG

mattermost-redux

Version:

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

24 lines (23 loc) 876 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.getServerLimits = getServerLimits; exports.getPostHistoryLimit = getPostHistoryLimit; exports.hasPostHistoryLimit = hasPostHistoryLimit; exports.shouldShowPostHistoryLimits = shouldShowPostHistoryLimits; function getServerLimits(state) { return state.entities.limits.serverLimits; } // Add new selectors for post history limits function getPostHistoryLimit(state) { const limits = getServerLimits(state); return limits?.postHistoryLimit ?? 0; } function hasPostHistoryLimit(state) { const limits = getServerLimits(state); return (limits?.postHistoryLimit ?? 0) > 0; } function shouldShowPostHistoryLimits(state) { return getPostHistoryLimit(state) > 0; }