Merge pull request #4911 from daweilv/master
fix(address): clicking on the Balance History chart within the /testnet/address/:id page would incorrectly navigate to /tx/:tx
This commit is contained in:
commit
91a8a8be34
3
contributors/daweilv.txt
Normal file
3
contributors/daweilv.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
I hereby accept the terms of the Contributor License Agreement in the CONTRIBUTING.md file of the mempool/mempool git repository as of April 7, 2024.
|
||||||
|
|
||||||
|
Signed: daweilv
|
@ -6,6 +6,7 @@ import { ChainStats } from '../../interfaces/electrs.interface';
|
|||||||
import { ElectrsApiService } from '../../services/electrs-api.service';
|
import { ElectrsApiService } from '../../services/electrs-api.service';
|
||||||
import { AmountShortenerPipe } from '../../shared/pipes/amount-shortener.pipe';
|
import { AmountShortenerPipe } from '../../shared/pipes/amount-shortener.pipe';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
|
import { RelativeUrlPipe } from '../../shared/pipes/relative-url/relative-url.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-address-graph',
|
selector: 'app-address-graph',
|
||||||
@ -46,6 +47,7 @@ export class AddressGraphComponent implements OnChanges {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private amountShortenerPipe: AmountShortenerPipe,
|
private amountShortenerPipe: AmountShortenerPipe,
|
||||||
private cd: ChangeDetectorRef,
|
private cd: ChangeDetectorRef,
|
||||||
|
private relativeUrlPipe: RelativeUrlPipe,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
@ -122,7 +124,7 @@ export class AddressGraphComponent implements OnChanges {
|
|||||||
</div>
|
</div>
|
||||||
<span>${date}</span>
|
<span>${date}</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
@ -178,7 +180,7 @@ export class AddressGraphComponent implements OnChanges {
|
|||||||
|
|
||||||
onChartClick(e) {
|
onChartClick(e) {
|
||||||
if (this.hoverData?.length && this.hoverData[0]?.[2]?.txid) {
|
if (this.hoverData?.length && this.hoverData[0]?.[2]?.txid) {
|
||||||
this.router.navigate(['/tx/', this.hoverData[0][2].txid]);
|
this.router.navigate([this.relativeUrlPipe.transform('/tx/'), this.hoverData[0][2].txid]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user