From 05fe51624914f805b8c8dc3cc81ed534dfeca2e3 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Mon, 4 Jun 2018 20:06:34 -0400 Subject: [PATCH] v0.0.1-alpha.10 - Hotfix for startup error. --- app/assets/js/configmanager.js | 1 + app/assets/js/scripts/uibinder.js | 6 ++++++ app/assets/js/scripts/uicore.js | 1 - index.js | 9 ++++----- package-lock.json | 2 +- package.json | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/assets/js/configmanager.js b/app/assets/js/configmanager.js index dc27734f..37e9563c 100644 --- a/app/assets/js/configmanager.js +++ b/app/assets/js/configmanager.js @@ -85,6 +85,7 @@ exports.load = function(){ config = validateKeySet(DEFAULT_CONFIG, config) exports.save() } + console.log('%c[ConfigManager]', 'color: #a02d2a; font-weight: bold', 'Successfully Loaded') } /** diff --git a/app/assets/js/scripts/uibinder.js b/app/assets/js/scripts/uibinder.js index b790ea5b..a914f754 100644 --- a/app/assets/js/scripts/uibinder.js +++ b/app/assets/js/scripts/uibinder.js @@ -54,6 +54,12 @@ function getCurrentView(){ } function showMainUI(){ + + if(!isDev){ + console.log('%c[AutoUpdater]', 'color: #a02d2a; font-weight: bold', 'Initializing..') + ipcRenderer.send('autoUpdateAction', 'initAutoUpdater', ConfigManager.getAllowPrerelease()) + } + updateSelectedServer(AssetGuard.getServerById(ConfigManager.getSelectedServer()).name) refreshServerStatus() setTimeout(() => { diff --git a/app/assets/js/scripts/uicore.js b/app/assets/js/scripts/uicore.js index a3d89965..5518215b 100644 --- a/app/assets/js/scripts/uicore.js +++ b/app/assets/js/scripts/uicore.js @@ -67,7 +67,6 @@ if(!isDev){ break } }) - ipcRenderer.send('autoUpdateAction', 'initAutoUpdater') } /** diff --git a/index.js b/index.js index e9e931b2..44d14ea6 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ // Requirements const {app, BrowserWindow, ipcMain} = require('electron') const autoUpdater = require('electron-updater').autoUpdater -const ConfigManager = require('./app/assets/js/configmanager.js') const ejse = require('ejs-electron') const fs = require('fs') const isDev = require('electron-is-dev') @@ -10,9 +9,9 @@ const semver = require('semver') const url = require('url') // Setup auto updater. -function initAutoUpdater(event) { - - if(ConfigManager.getAllowPrerelease()){ +function initAutoUpdater(event, data) { + + if(data){ autoUpdater.allowPrerelease = true } else { // Defaults to true if application version contains prerelease components (e.g. 0.12.1-alpha.1) @@ -42,7 +41,7 @@ ipcMain.on('autoUpdateAction', (event, arg, data) => { switch(arg){ case 'initAutoUpdater': console.log('Initializing auto updater.') - initAutoUpdater(event) + initAutoUpdater(event, data) event.sender.send('autoUpdateNotification', 'ready') break case 'checkForUpdate': diff --git a/package-lock.json b/package-lock.json index 80724579..cca4da2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "westeroscraftlauncher", - "version": "0.0.1-alpha.9", + "version": "0.0.1-alpha.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8bdb4770..85f6975e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "westeroscraftlauncher", - "version": "0.0.1-alpha.9", + "version": "0.0.1-alpha.10", "description": "Custom modded launcher for Westeroscraft", "productName": "WesterosCraft Launcher", "main": "index.js",