Commit 3fd6dfaf authored by dev0tion's avatar dev0tion

Fix double click behaviour

parent 5d2e3ac1
......@@ -6,7 +6,7 @@
<img src="../../../assets/images/ico_bitcoin.svg" alt="Bitcoin">
<span class="bar"></span>
</li>
<li (click)="loadStratisWallet()" [class.active]="!bitcoinActive">
<li (click)="loadStratisWallet()" [class.active]="stratisActive">
<img src="../../../assets/images/ico_stratis.svg" alt="Stratis">
<span class="bar"></span>
</li>
......
......@@ -14,33 +14,34 @@ export class SidebarComponent implements OnInit {
constructor(private globalService: GlobalService, private router: Router, private modalService: NgbModal) { }
private bitcoinActive: Boolean;
private stratisActive: Boolean;
ngOnInit() {
if (this.globalService.getCoinName() === "Bitcoin" || this.globalService.getCoinName() === "TestBitcoin") {
this.bitcoinActive = true;
this.stratisActive = false;
} else if (this.globalService.getCoinName() === "Stratis" || this.globalService.getCoinName() === "TestStratis") {
this.bitcoinActive = false;
this.stratisActive = true;
}
}
private loadBitcoinWallet() {
this.toggleClass();
this.bitcoinActive = true;
this.stratisActive = false;
this.globalService.setCoinName("TestBitcoin");
this.globalService.setCoinUnit("TBTC");
this.router.navigate(['/wallet']);
}
private loadStratisWallet() {
this.toggleClass();
this.bitcoinActive = false;
this.stratisActive = true;
this.globalService.setCoinName("TestStratis");
this.globalService.setCoinUnit("TSTRAT");
this.router.navigate(['/wallet/stratis-wallet']);
}
private toggleClass(){
this.bitcoinActive = !this.bitcoinActive;
}
private logOut() {
const modalRef = this.modalService.open(LogoutConfirmationComponent);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment