UNPKG

mattermost-redux

Version:

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

15 lines (14 loc) 635 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.getCurrentUserLocale = getCurrentUserLocale; const constants_1 = require("mattermost-redux/constants"); const common_1 = require("mattermost-redux/selectors/entities/common"); function getCurrentUserLocale(state, defaultLocale = constants_1.General.DEFAULT_LOCALE) { const currentUser = (0, common_1.getCurrentUser)(state); if (!currentUser) { return defaultLocale; } return currentUser.locale || defaultLocale; }