From 84bf26e52746a3a7345141f097b6c41ead261ef4 Mon Sep 17 00:00:00 2001 From: Luca Zeug Date: Tue, 17 Jan 2017 20:35:26 +0100 Subject: [PATCH] update dependency and fix ESLint --- .../popupWindows/onboardingScreen.js | 30 +++++++++---------- modules/ipcCommunicator.js | 15 +++++----- package.json | 2 +- yarn.lock | 2 +- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/interface/client/templates/popupWindows/onboardingScreen.js b/interface/client/templates/popupWindows/onboardingScreen.js index d4dbab13e..12a40234f 100644 --- a/interface/client/templates/popupWindows/onboardingScreen.js +++ b/interface/client/templates/popupWindows/onboardingScreen.js @@ -92,14 +92,14 @@ Template['popupWindows_onboardingScreen'].helpers({ // Create an interval to quickly iterate trough the numbers template._intervalId = Meteor.setInterval(function(){ // load the sync information - var syncing = TemplateVar.get(template, 'syncing'); + var syncing = TemplateVar.get(template, 'syncing'); if (syncing) { // If it's syncing, then it's not ready TemplateVar.set(template, 'readyToLaunch', false); // Calculates a block t display that is always getting a few % closer to target - syncing._displayBlock = (syncing._displayBlock + 2*(syncing.currentBlock - syncing._displayBlock) / 100 ) || Number(syncing.startingBlock); + syncing._displayBlock = (syncing._displayBlock + 2*(syncing.currentBlock - syncing._displayBlock) / 100 ) || Number(syncing.startingBlock); syncing._displayStatesDownload = Number(syncing._displayStatesDownload + (syncing.pulledStates/(1 +syncing.knownStates) - syncing._displayStatesDownload) / 100 ) || Number(syncing.pulledStates)/Number(syncing.knownStates + 1); @@ -140,7 +140,7 @@ Template['popupWindows_onboardingScreen'].helpers({ @method syncStatusMessage */ 'syncStatusMessage' : function() { - return TemplateVar.get("syncStatusMessageLive"); + return TemplateVar.get("syncStatusMessageLive"); } }); @@ -162,7 +162,7 @@ Template['popupWindows_onboardingScreen'].events({ if(!TemplateVar.get('testnet')) { ipc.send('onBoarding_changeNet', true); TemplateVar.set('testnet', true); - TemplateVar.set('syncing', null); + TemplateVar.set('syncing', null); } TemplateVar.set('currentActive','testnet'); @@ -177,17 +177,17 @@ Template['popupWindows_onboardingScreen'].events({ }, 'click .goto-tutorial-1': function(){ TemplateVar.set('currentActive','tutorial-1'); - if (!TemplateVar.get('syncing')) + if (!TemplateVar.get('syncing')) TemplateVar.set('readyToLaunch', true); }, 'click .goto-tutorial-2': function(){ TemplateVar.set('currentActive','tutorial-2'); - if (!TemplateVar.get('syncing')) + if (!TemplateVar.get('syncing')) TemplateVar.set('readyToLaunch', true); }, 'click .goto-tutorial-3': function(){ TemplateVar.set('currentActive','tutorial-3'); - if (!TemplateVar.get('syncing')) + if (!TemplateVar.get('syncing')) TemplateVar.set('readyToLaunch', true); }, /** @@ -265,7 +265,7 @@ Template['popupWindows_onboardingScreen_importAccount'].events({ }); } else if (type === 'web3') { TemplateVar.set(template, 'importing', true); - setTimeout(() => { + setTimeout(function() { ipc.send('backendAction_closePopupWindow'); }, 750); } else if (type === 'invalid') { @@ -302,7 +302,7 @@ Template['popupWindows_onboardingScreen_importAccount'].events({ }, /** Checks the password match sends the file path and password to the mist backend to import - + @event submit form */ 'submit form': function(e, template){ @@ -324,7 +324,7 @@ Template['popupWindows_onboardingScreen_importAccount'].events({ if($('.onboarding-start')[0]) { TemplateVar.setTo('.onboarding-account', 'newAccount', web3.toChecksumAddress(address)); TemplateVar.setTo('.onboarding-screen', 'currentActive', 'account'); - + // otherwise simply close the window } else { ipc.send('backendAction_closePopupWindow'); @@ -378,7 +378,7 @@ Template['popupWindows_onboardingScreen_password'].helpers({ Template['popupWindows_onboardingScreen_password'].events({ /** Clear the form - + @event click button[type="button"] */ 'click button[type="button"]': function(e, template){ @@ -395,7 +395,7 @@ Template['popupWindows_onboardingScreen_password'].events({ }, /** Password checks - + @event click button[type="button"] */ 'input input, change input': function(e, template){ @@ -408,7 +408,7 @@ Template['popupWindows_onboardingScreen_password'].events({ }, /** Checks the password match and creates a new account - + @event submit form */ 'submit form': function(e, template){ @@ -433,7 +433,7 @@ Template['popupWindows_onboardingScreen_password'].events({ if(!e) { TemplateVar.setTo('.onboarding-account', 'newAccount', web3.toChecksumAddress(res)); TemplateVar.setTo('.onboarding-screen', 'currentActive', 'account'); - + // clear form pw = pwRepeat = null; @@ -446,4 +446,4 @@ Template['popupWindows_onboardingScreen_password'].events({ }); } } -}); \ No newline at end of file +}); diff --git a/modules/ipcCommunicator.js b/modules/ipcCommunicator.js index 9a58b93b0..8f3eab8c7 100644 --- a/modules/ipcCommunicator.js +++ b/modules/ipcCommunicator.js @@ -178,8 +178,8 @@ ipc.on('backendAction_importWalletFile', (e, path, pw) => { error = true; e.sender.send('uiAction_importedWalletFile', 'Couldn\'t start the "geth wallet import " process.'); }); - nodeProcess.stdout.on('data', (data) => { - data = data.toString(); + nodeProcess.stdout.on('data', (_data) => { + const data = _data.toString(); if (data) { log.info('Imported presale: ', data); } @@ -189,11 +189,12 @@ ipc.on('backendAction_importWalletFile', (e, path, pw) => { // if imported, return the address } else if (data.indexOf('Address:') !== -1) { - var find = data.match(/\{([a-f0-9]+)\}/i); - if (find.length && find[1]) - e.sender.send('uiAction_importedWalletFile', null, '0x' + find[1]); - else + const find = data.match(/\{([a-f0-9]+)\}/i); + if (find.length && find[1]) { + e.sender.send('uiAction_importedWalletFile', null, `0x${find[1]}`); + } else { e.sender.send('uiAction_importedWalletFile', data); + } // if not stop, so we don't kill the process } else { @@ -209,7 +210,7 @@ ipc.on('backendAction_importWalletFile', (e, path, pw) => { setTimeout(() => { if (!error) { nodeProcess.stdin.write(`${pw}\n`); - pw = null; + pw = null; // eslint-disable-line no-param-reassign } }, 2000); }); diff --git a/package.json b/package.json index 01d56387c..e68edf035 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "bluebird": "^3.3.5", "electron-squirrel-startup": "^1.0.0", "ethereum-client-binaries": "^1.6.1", - "ethereum-keyfile-recognizer": "^1.0.1", + "ethereum-keyfile-recognizer": "^1.0.2", "ethereumjs-abi": "^0.6.3", "got": "^6.3.0", "i18next": "^2.3.4", diff --git a/yarn.lock b/yarn.lock index efa3ec7c9..e51c54dab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1318,7 +1318,7 @@ ethereum-client-binaries@^1.6.1: node-unzip-2 "^0.2.1" tmp "0.0.29" -ethereum-keyfile-recognizer@^1.0.1: +ethereum-keyfile-recognizer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/ethereum-keyfile-recognizer/-/ethereum-keyfile-recognizer-1.0.2.tgz#c0315f91c77e076621e9f6b5f8099fd370f7a11d" dependencies: