Skip to content

Commit

Permalink
Update wallet.js
Browse files Browse the repository at this point in the history
fix bug when create new wallet
  • Loading branch information
xiaojay committed Apr 17, 2019
1 parent 1eeef3b commit 03aa754
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shared/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@ class WalletService {
static new(password){
const cmd = platform==='win'? `${path.resolve(grinPath)} -r ${grinNode} --pass ${password} init`:
`${grinPath} -r ${grinNode} init`
log.debug(`platform: ${platform}; int wallet cmd: ${cmd}`)
//log.debug(`platform: ${platform}; int wallet cmd: ${cmd}`)
let createProcess = exec(cmd)
createProcess.stdout.on('data', (data) => {
var output = data.toString()
//log.debug('init process return: '+output)
if (output.includes("Please enter a password for your new wallet")){
createProcess.stdin.write(password + "\n");
createProcess.stdin.write(password + "\n");
Expand All @@ -232,7 +233,8 @@ class WalletService {
var wordSeedWithLog = wordSeed;
var wordSeedWithoutLog = wordSeedWithLog.substring(wordSeedWithLog.indexOf("==")+1);
wordSeedWithoutLog = wordSeedWithoutLog.trim();
wordSeedWithoutLog = wordSeedWithoutLog.replace("= ","");
wordSeedWithoutLog = wordSeedWithoutLog.replace("= ","").trim();
//log.debug(`wordSeed: ${wordSeed}; wordSeedWithoutLog: ${wordSeedWithoutLog}`)
return messageBus.$emit('walletCreated', wordSeedWithoutLog)
}
})
Expand Down

0 comments on commit 03aa754

Please sign in to comment.