Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
update dependency and fix ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Zeug committed Jan 17, 2017
1 parent f9fe5c6 commit 84bf26e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
30 changes: 15 additions & 15 deletions interface/client/templates/popupWindows/onboardingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -140,7 +140,7 @@ Template['popupWindows_onboardingScreen'].helpers({
@method syncStatusMessage
*/
'syncStatusMessage' : function() {
return TemplateVar.get("syncStatusMessageLive");
return TemplateVar.get("syncStatusMessageLive");
}
});

Expand All @@ -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');
Expand All @@ -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);
},
/**
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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){
Expand All @@ -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');
Expand Down Expand Up @@ -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){
Expand All @@ -395,7 +395,7 @@ Template['popupWindows_onboardingScreen_password'].events({
},
/**
Password checks
@event click button[type="button"]
*/
'input input, change input': function(e, template){
Expand All @@ -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){
Expand All @@ -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;

Expand All @@ -446,4 +446,4 @@ Template['popupWindows_onboardingScreen_password'].events({
});
}
}
});
});
15 changes: 8 additions & 7 deletions modules/ipcCommunicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <file.json>" 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);
}
Expand All @@ -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 {
Expand All @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 84bf26e

Please sign in to comment.