diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-05-04 15:45:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-04 15:45:19 -0400 |
commit | 49481caf6db89b0853626ac52ab5f786a6887179 (patch) | |
tree | 128991892f16d7830097c217db689410a002eb73 /webapp/root.jsx | |
parent | 44a8f76d993cdd97785cab7fd55ad9f07c3c757a (diff) | |
download | chat-49481caf6db89b0853626ac52ab5f786a6887179.tar.gz chat-49481caf6db89b0853626ac52ab5f786a6887179.tar.bz2 chat-49481caf6db89b0853626ac52ab5f786a6887179.zip |
PLT-6262 Add config setting to disable file attachments (#6301)
* Add config setting to disable file attachments
* Add unit tests
* Updating UI for no attachments (#6312)
* Update UI text on file upload System Console setting (#6313)
* Update storage_settings.jsx
* Update en.json
Diffstat (limited to 'webapp/root.jsx')
-rw-r--r-- | webapp/root.jsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/webapp/root.jsx b/webapp/root.jsx index 6a63e6dad..03595f85c 100644 --- a/webapp/root.jsx +++ b/webapp/root.jsx @@ -12,7 +12,6 @@ import PDFJS from 'pdfjs-dist'; import * as Websockets from 'actions/websocket_actions.jsx'; import {loadMeAndConfig} from 'actions/user_actions.jsx'; -import BrowserStore from 'stores/browser_store.jsx'; import ChannelStore from 'stores/channel_store.jsx'; import UserStore from 'stores/user_store.jsx'; import * as I18n from 'i18n/i18n.jsx'; @@ -86,7 +85,6 @@ function preRenderSetup(callwhendone) { () => { // Turn off to prevent getting stuck in a loop $(window).off('beforeunload'); - BrowserStore.setLastServerVersion(''); if (UserStore.getCurrentUser()) { viewChannel('', ChannelStore.getCurrentId() || '')(dispatch, getState); } @@ -120,6 +118,18 @@ function renderRootComponent() { document.getElementById('root')); } +let serverVersion = ''; + +store.subscribe(() => { + const newServerVersion = getState().entities.general.serverVersion; + if (serverVersion && serverVersion !== newServerVersion) { + console.log('Detected version update refreshing the page'); //eslint-disable-line no-console + window.location.reload(true); + } + + serverVersion = newServerVersion; +}); + global.window.setup_root = () => { // Do the pre-render setup and call renderRootComponent when done preRenderSetup(renderRootComponent); |