summaryrefslogtreecommitdiffstats
path: root/web/templates/head.html
diff options
context:
space:
mode:
Diffstat (limited to 'web/templates/head.html')
-rw-r--r--web/templates/head.html20
1 files changed, 15 insertions, 5 deletions
diff --git a/web/templates/head.html b/web/templates/head.html
index 4060d2410..b1ec905b5 100644
--- a/web/templates/head.html
+++ b/web/templates/head.html
@@ -62,8 +62,11 @@
<style id="antiClickjack">body{display:none !important;}</style>
<script>
- ReactIntl.addLocaleData(ReactIntlLocaleData.en);
- ReactIntl.addLocaleData(ReactIntlLocaleData.es);
+ if ('ReactIntl' in window && 'ReactIntlLocaleData' in window) {
+ Object.keys(ReactIntlLocaleData).forEach(function(lang) {
+ ReactIntl.addLocaleData(ReactIntlLocaleData[lang]);
+ });
+ }
window.mm_config = {{ .ClientCfg }};
window.mm_license = {{ .ClientLicense }};
@@ -71,6 +74,13 @@
window.mm_user = {{ .User }};
window.mm_channel = {{ .Channel }};
window.mm_locale = {{ .Locale }};
+ window.mm_preferences = {{ .Preferences }};
+
+ $(function() {
+ if (window.mm_preferences != null) {
+ PreferenceStore.setPreferences(window.mm_preferences);
+ }
+ });
if ({{.SessionTokenIndex}} >= 0) {
window.mm_session_token_index = {{.SessionTokenIndex}};
@@ -78,13 +88,13 @@
headers: {
'X-MM-TokenIndex': mm_session_token_index,
'Accept-Language': mm_locale
- }
+ }
});
} else {
$.ajaxSetup({
headers: {
'Accept-Language': mm_locale
- }
+ }
});
}
@@ -108,7 +118,7 @@
}
console.log('detected login from a different tab');
- window.location.href = '/' + window.mm_team.name;
+ location.reload();
}
});
});