From b307a6d64e85eec70d1a5054cf5778bec712b9a7 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 3 Feb 2016 16:50:05 +0000 Subject: [PATCH] Invoke onVersion when we know the current version even if there is no new version (for settings) --- src/vector/index.js | 6 +++--- src/vector/updater.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index 552f0c24b4..1d845adf06 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -106,8 +106,8 @@ function onHashChange(ev) { routeUrl(window.location); } -function onNewVersion(current, latest) { - window.matrixChat.onNewVersion(current, latest); +function onVersion(current, latest) { + window.matrixChat.onVersion(current, latest); } var loaded = false; @@ -143,7 +143,7 @@ window.onload = function() { if (!validBrowser) { return; } - UpdateChecker.setNewVersionListener(onNewVersion); + UpdateChecker.setVersionListener(onVersion); UpdateChecker.run(); routeUrl(window.location); loaded = true; diff --git a/src/vector/updater.js b/src/vector/updater.js index a818bd3f72..0daba7285d 100644 --- a/src/vector/updater.js +++ b/src/vector/updater.js @@ -19,7 +19,7 @@ var latestVersion = null; var listener = function(){}; // NOP module.exports = { - setNewVersionListener: function(fn) { // invoked with fn(currentVer, newVer) + setVersionListener: function(fn) { // invoked with fn(currentVer, newVer) listener = fn; }, @@ -32,6 +32,7 @@ module.exports = { var ver = req.responseText.trim(); if (!currentVersion) { currentVersion = ver; + listener(currentVersion, currentVersion); } if (ver !== latestVersion) {