diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-08-02 08:44:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-02 08:44:25 -0400 |
commit | 6ff7e4ea4b23a50a65d295aae163fb96f21cdcff (patch) | |
tree | 6a6577b47bd8766bafee2e4ecb9e663138a388f0 /webapp/actions/global_actions.jsx | |
parent | 65817e13c7900ea81947e40e177459cfea8acee4 (diff) | |
download | chat-6ff7e4ea4b23a50a65d295aae163fb96f21cdcff.tar.gz chat-6ff7e4ea4b23a50a65d295aae163fb96f21cdcff.tar.bz2 chat-6ff7e4ea4b23a50a65d295aae163fb96f21cdcff.zip |
Change refresh on version change to be after explicit click (#7090)
Diffstat (limited to 'webapp/actions/global_actions.jsx')
-rw-r--r-- | webapp/actions/global_actions.jsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx index ce14661f6..f464483cf 100644 --- a/webapp/actions/global_actions.jsx +++ b/webapp/actions/global_actions.jsx @@ -67,6 +67,7 @@ export function emitChannelClickEvent(channel) { // Mark previous and next channel as read ChannelStore.resetCounts([chan.id, oldChannelId]); + reloadIfServerVersionChanged(); }); // Subtract mentions for the team @@ -593,3 +594,15 @@ export function emitPopoverMentionKeyClick(isRHS, mentionKey) { mentionKey }); } + +let serverVersion = ''; + +export function reloadIfServerVersionChanged() { + const newServerVersion = Client4.getServerVersion(); + if (serverVersion && serverVersion !== newServerVersion) { + console.log('Detected version update refreshing the page'); //eslint-disable-line no-console + window.location.reload(true); + } + + serverVersion = newServerVersion; +} |