summaryrefslogtreecommitdiffstats
path: root/webapp/actions/global_actions.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-08-02 08:44:25 -0400
committerGitHub <noreply@github.com>2017-08-02 08:44:25 -0400
commit6ff7e4ea4b23a50a65d295aae163fb96f21cdcff (patch)
tree6a6577b47bd8766bafee2e4ecb9e663138a388f0 /webapp/actions/global_actions.jsx
parent65817e13c7900ea81947e40e177459cfea8acee4 (diff)
downloadchat-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.jsx13
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;
+}