forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
general.js
25 lines (18 loc) · 652 Bytes
/
general.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import * as UserAgent from 'utils/user_agent';
export function areTimezonesEnabledAndSupported(state) {
if (UserAgent.isInternetExplorer()) {
return false;
}
const config = getConfig(state);
return config.ExperimentalTimezone === 'true';
}
export function getBasePath(state) {
const config = getConfig(state) || {};
if (config.SiteURL) {
return new URL(config.SiteURL).pathname;
}
return window.basename || '/';
}