Merge pull request #15 from wownero/fix-wallets-json

Fix wallet breaking error on startup
pull/18/head 0.1.2
xmrdsc 5 years ago committed by GitHub
commit 575f5b0d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -61,6 +61,7 @@ export class Config {
}
saveLastWalletPath(path){
console.log(this.data);
if (typeof this.data === 'string' || this.data instanceof String){
this.data = JSON.parse(this.data);
}
@ -69,6 +70,10 @@ export class Config {
return;
}
if(!this.data.hasOwnProperty('wallets')){
this.data.wallets = [];
}
const name = path.split('/').pop();
this.data.wallets.push({ name, path });
this.save();