Commit 3fd6dfaf authored by dev0tion's avatar dev0tion

Fix double click behaviour

parent 5d2e3ac1
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<img src="../../../assets/images/ico_bitcoin.svg" alt="Bitcoin"> <img src="../../../assets/images/ico_bitcoin.svg" alt="Bitcoin">
<span class="bar"></span> <span class="bar"></span>
</li> </li>
<li (click)="loadStratisWallet()" [class.active]="!bitcoinActive"> <li (click)="loadStratisWallet()" [class.active]="stratisActive">
<img src="../../../assets/images/ico_stratis.svg" alt="Stratis"> <img src="../../../assets/images/ico_stratis.svg" alt="Stratis">
<span class="bar"></span> <span class="bar"></span>
</li> </li>
......
...@@ -14,33 +14,34 @@ export class SidebarComponent implements OnInit { ...@@ -14,33 +14,34 @@ export class SidebarComponent implements OnInit {
constructor(private globalService: GlobalService, private router: Router, private modalService: NgbModal) { } constructor(private globalService: GlobalService, private router: Router, private modalService: NgbModal) { }
private bitcoinActive: Boolean; private bitcoinActive: Boolean;
private stratisActive: Boolean;
ngOnInit() { ngOnInit() {
if (this.globalService.getCoinName() === "Bitcoin" || this.globalService.getCoinName() === "TestBitcoin") { if (this.globalService.getCoinName() === "Bitcoin" || this.globalService.getCoinName() === "TestBitcoin") {
this.bitcoinActive = true; this.bitcoinActive = true;
this.stratisActive = false;
} else if (this.globalService.getCoinName() === "Stratis" || this.globalService.getCoinName() === "TestStratis") { } else if (this.globalService.getCoinName() === "Stratis" || this.globalService.getCoinName() === "TestStratis") {
this.bitcoinActive = false; this.bitcoinActive = false;
this.stratisActive = true;
} }
} }
private loadBitcoinWallet() { private loadBitcoinWallet() {
this.toggleClass(); this.bitcoinActive = true;
this.stratisActive = false;
this.globalService.setCoinName("TestBitcoin"); this.globalService.setCoinName("TestBitcoin");
this.globalService.setCoinUnit("TBTC"); this.globalService.setCoinUnit("TBTC");
this.router.navigate(['/wallet']); this.router.navigate(['/wallet']);
} }
private loadStratisWallet() { private loadStratisWallet() {
this.toggleClass(); this.bitcoinActive = false;
this.stratisActive = true;
this.globalService.setCoinName("TestStratis"); this.globalService.setCoinName("TestStratis");
this.globalService.setCoinUnit("TSTRAT"); this.globalService.setCoinUnit("TSTRAT");
this.router.navigate(['/wallet/stratis-wallet']); this.router.navigate(['/wallet/stratis-wallet']);
} }
private toggleClass(){
this.bitcoinActive = !this.bitcoinActive;
}
private logOut() { private logOut() {
const modalRef = this.modalService.open(LogoutConfirmationComponent); 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