Fix autoupdate to ship autoupdateVersion to the client

This commit is contained in:
Matthew Arbesfeld
2014-08-15 15:57:53 -07:00
parent bc6239dfc1
commit da08cc421e
2 changed files with 4 additions and 7 deletions

View File

@@ -78,8 +78,7 @@ Autoupdate._retrySubscription = function () {
if (Package.reload) {
var checkNewVersionDocument = function (id, fields) {
var self = this;
var isRefreshable = id === 'version-refreshable';
if (isRefreshable &&
if (id === 'version-refreshable' &&
fields.version !== autoupdateVersionRefreshable) {
autoupdateVersionRefreshable = fields.version;
// Switch out old css links for the new css links. Inspired by:
@@ -131,7 +130,7 @@ Autoupdate._retrySubscription = function () {
attachStylesheetLink(newLink);
});
}
else if (! isRefreshable &&
else if (id === 'version' &&
fields.version !== autoupdateVersion && handle) {
handle.stop();
Package.reload.Reload._reload();

View File

@@ -116,9 +116,7 @@ Meteor.startup(function () {
// Allow people to override Autoupdate.autoupdateVersion before startup.
// Tests do this.
startupVersion = Autoupdate.autoupdateVersion;
WebApp.onListening(function () {
updateVersions(false);
});
updateVersions(false);
});
Meteor.publish(
@@ -132,4 +130,4 @@ Meteor.publish(
// Listen for SIGUSR2, which signals that a client asset has changed.
process.on('SIGUSR2', Meteor.bindEnvironment(function () {
updateVersions(true);
}));
}));