Skip to content

Commit

Permalink
Merge pull request #18 from Mikeli2016/master
Browse files Browse the repository at this point in the history
add check conditions when create wallet and delete useless component
  • Loading branch information
Mikeli2016 authored Mar 4, 2020
2 parents f15400f + 86741a4 commit de467d6
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 278 deletions.
4 changes: 0 additions & 4 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes} from '@angular/router';
import { ManageComponent } from './manage/manage.component';
import { AddWalletComponent } from './manage/add-wallet/add-wallet.component';
// import { MnemonicComponent } from './manage/mnemonic/mnemonic.component';
// import { VerifyMnemonicComponent } from './manage/verify-mnemonic/verify-mnemonic.component';
import { ImportWalletComponent } from './manage/import-wallet/import-wallet.component';
import { NotfoundComponent } from './notfound/notfound.component';
import { DetailsComponent } from './manage/details/details.component';
Expand All @@ -24,8 +22,6 @@ const routes: Routes = [
]
},
{ path: 'add-wallet', component: AddWalletComponent, outlet: 'popup'},
// { path: 'mnemonic', component: MnemonicComponent, outlet: 'popup'},
// { path: 'verify-mnemonic', component: VerifyMnemonicComponent, outlet: 'popup'},
{ path: 'import-wallet', component: ImportWalletComponent, outlet: 'popup'},
{ path: 'export-key', component: ExportKeyComponent, outlet: 'popup'},
{ path: 'export-keystore', component: ExportKeystoreComponent, outlet: 'popup'},
Expand Down
4 changes: 0 additions & 4 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { HeadComponent } from './head/head.component';
import { AppRoutingModule } from './/app-routing.module';
import { FormsModule } from '@angular/forms';
import { AddWalletComponent } from './manage/add-wallet/add-wallet.component';
// import { MnemonicComponent } from './manage/mnemonic/mnemonic.component';
// import { VerifyMnemonicComponent } from './manage/verify-mnemonic/verify-mnemonic.component';
import { ImportWalletComponent } from './manage/import-wallet/import-wallet.component';
import { NotfoundComponent } from './notfound/notfound.component';
import { DetailsComponent } from './manage/details/details.component';
Expand All @@ -35,8 +33,6 @@ import { TranslationService } from './translation.service';
ManageComponent,
HeadComponent,
AddWalletComponent,
// MnemonicComponent,
// VerifyMnemonicComponent,
ImportWalletComponent,
NotfoundComponent,
DetailsComponent,
Expand Down
18 changes: 12 additions & 6 deletions src/app/manage/add-wallet/add-wallet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,18 @@ export class AddWalletComponent implements OnInit {
this.newAccount['address'] = pkey;
this.newAccount['privateKey'] = privateKey;
this.newAccount['keystore'] = keystore;
const newAcc = new Account(this.newAccount);
this.walletService.addAccount(newAcc);
this.walletService.clearAccountDetail();
this.downloadKeystore(keystore);

this.router.navigateByUrl('/dashboard/main');

if(this.newAccount['mnemonic']!=null && this.newAccount['mnemonic']!="" && this.newAccount['address'].substring(0,4)!="0x95"){
const newAcc = new Account(this.newAccount);
this.walletService.addAccount(newAcc);
this.walletService.clearAccountDetail();
this.downloadKeystore(keystore);
this.router.navigateByUrl('/dashboard/main');
}
else{
alert("We are sorry. Create wallet failed, please try again.")
}

} catch (e) {
console.error(e);
}
Expand Down
28 changes: 0 additions & 28 deletions src/app/manage/mnemonic/mnemonic.component.html

This file was deleted.

35 changes: 0 additions & 35 deletions src/app/manage/mnemonic/mnemonic.component.spec.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/app/manage/mnemonic/mnemonic.component.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/app/manage/verify-mnemonic/verify-mnemonic.component.html

This file was deleted.

35 changes: 0 additions & 35 deletions src/app/manage/verify-mnemonic/verify-mnemonic.component.spec.ts

This file was deleted.

96 changes: 0 additions & 96 deletions src/app/manage/verify-mnemonic/verify-mnemonic.component.ts

This file was deleted.

5 changes: 2 additions & 3 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
let isPro = true;
let isPro = false;
export const environment = {
production: isPro,

network: (isPro?"https://api.nbai.io":"http://192.168.88.217:8545"),
apiUrl: (isPro?"https://api1.nbai.io":'http://192.168.88.217:8093'),
scanUrl: (isPro?"https://scan.nbai.io/#/":'http://192.168.88.216:8080/NBAITestExploer/#/')

scanUrl: (isPro?"https://scan.nbai.io/#/":'http://192.168.88.216:8080/NBAITestExploer/#/')
};

0 comments on commit de467d6

Please sign in to comment.