From 18aefe39a6e21fcbdf6597f861017ca238e75df1 Mon Sep 17 00:00:00 2001 From: Jeff Morgan Date: Thu, 11 Sep 2014 16:16:19 -0700 Subject: [PATCH] Fixing remaining bugs. --- index.js | 7 +++++-- meteor/client/lib/installer.js | 8 ++++---- meteor/client/main.js | 4 ++++ meteor/client/views/dashboard/setup/setup-finish.js | 2 +- meteor/client/views/dashboard/setup/setup-layout.js | 6 ------ 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 58d006cf6..a838b66b4 100644 --- a/index.js +++ b/index.js @@ -140,7 +140,10 @@ app.on('ready', function() { // and load the index.html of the app. mainWindow.loadUrl(url); - mainWindow.show(); - mainWindow.focus(); + + mainWindow.webContents.on('did-finish-load', function () { + mainWindow.show(); + mainWindow.focus(); + }); }); }); diff --git a/meteor/client/lib/installer.js b/meteor/client/lib/installer.js index aeeebd177..e4b6ddaaa 100644 --- a/meteor/client/lib/installer.js +++ b/meteor/client/lib/installer.js @@ -7,7 +7,7 @@ var app = remote.require('app'); Installer = {}; Installer.CURRENT_VERSION = app.getVersion(); -Installer.baseURL = 'https://s3.amazonaws.com/kite-installer/'; +Installer.BASE_URL = 'https://s3.amazonaws.com/kite-installer/'; Installer.isUpToDate = function () { return !!Installs.findOne({version: Installer.CURRENT_VERSION}); @@ -25,7 +25,7 @@ Installer.steps = [ run: function (callback, progressCallback) { var installed = VirtualBox.installed(); if (!installed) { - Util.downloadFile(Installer.baseURL + VirtualBox.INSTALLER_FILENAME, path.join(Util.getResourceDir(), VirtualBox.INSTALLER_FILENAME), VirtualBox.INSTALLER_CHECKSUM, function (err) { + Util.downloadFile(Installer.BASE_URL + VirtualBox.INSTALLER_FILENAME, path.join(Util.getResourceDir(), VirtualBox.INSTALLER_FILENAME), VirtualBox.INSTALLER_CHECKSUM, function (err) { if (err) {callback(err); return;} VirtualBox.install(function (err) { if (!VirtualBox.installed()) { @@ -43,7 +43,7 @@ Installer.steps = [ if (err) {callback(err); return;} if (Util.compareVersions(installedVersion, VirtualBox.REQUIRED_VERSION) < 0) { // Download a newer version of Virtualbox - Util.downloadFile(Installer.baseURL + VirtualBox.INSTALLER_FILENAME, path.join(Util.getResourceDir(), VirtualBox.INSTALLER_FILENAME), VirtualBox.INSTALLER_CHECKSUM, function (err) { + Util.downloadFile(Installer.BASE_URL + VirtualBox.INSTALLER_FILENAME, path.join(Util.getResourceDir(), VirtualBox.INSTALLER_FILENAME), VirtualBox.INSTALLER_CHECKSUM, function (err) { if (err) {callback(err); return;} VirtualBox.install(function (err) { if (err) {callback(err); return;} @@ -148,7 +148,7 @@ Installer.steps = [ // Set up the default Kitematic images { run: function (callback, progressCallback) { - Util.downloadFile(Installer.baseURL + Docker.DEFAULT_IMAGES_FILENAME, path.join(Util.getResourceDir(), Docker.DEFAULT_IMAGES_FILENAME), Docker.DEFAULT_IMAGES_CHECKSUM, function (err) { + Util.downloadFile(Installer.BASE_URL + Docker.DEFAULT_IMAGES_FILENAME, path.join(Util.getResourceDir(), Docker.DEFAULT_IMAGES_FILENAME), Docker.DEFAULT_IMAGES_CHECKSUM, function (err) { Docker.reloadDefaultContainers(function (err) { callback(err); }); diff --git a/meteor/client/main.js b/meteor/client/main.js index 02d807b14..0e5c44ce7 100755 --- a/meteor/client/main.js +++ b/meteor/client/main.js @@ -63,6 +63,10 @@ Handlebars.registerHelper('timeSince', function (date) { return moment(date).fromNow(); }); +Handlebars.registerHelper('isUpdating', function (date) { + return Session.get('isUpdating'); +}); + var fixBoot2DockerVM = function (callback) { Boot2Docker.check(function (err) { if (err) { diff --git a/meteor/client/views/dashboard/setup/setup-finish.js b/meteor/client/views/dashboard/setup/setup-finish.js index 617dd6e08..8d4abf253 100644 --- a/meteor/client/views/dashboard/setup/setup-finish.js +++ b/meteor/client/views/dashboard/setup/setup-finish.js @@ -6,7 +6,7 @@ Template.setup_finish.events({ if (!settings) { Settings.insert({tracking: enableDiagnostics}); } else { - settings.update(settings._id, { + Settings.update(settings._id, { $set: { tracking: enableDiagnostics } diff --git a/meteor/client/views/dashboard/setup/setup-layout.js b/meteor/client/views/dashboard/setup/setup-layout.js index 2d99b3bc4..ac1dd47d2 100644 --- a/meteor/client/views/dashboard/setup/setup-layout.js +++ b/meteor/client/views/dashboard/setup/setup-layout.js @@ -3,9 +3,3 @@ Template.setup_layout.rendered = function () { $('.header .icons a').tooltip(); }, 1000); }; - -Template.setup_layout.helpers({ - isUpdating: function () { - return Session.get('isUpdating'); - } -});