Merge pull request #5551 from mempool/mononaut/utxo-chart-navigation

fix utxo chart on-click navigation
This commit is contained in:
wiz 2024-09-27 07:50:15 +09:00 committed by GitHub
commit 676abf58fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -344,13 +344,13 @@ export class UtxoGraphComponent implements OnChanges, OnDestroy {
}
onChartClick(e): void {
if (e.data?.[0]?.txid) {
if (e.data?.[1]?.txid) {
this.zone.run(() => {
const url = this.relativeUrlPipe.transform(`/tx/${e.data[0].txid}`);
const url = this.relativeUrlPipe.transform(`/tx/${e.data[1].txid}`);
if (e.event.event.shiftKey || e.event.event.ctrlKey || e.event.event.metaKey) {
window.open(url + '?mode=details#vout=' + e.data[0].vout);
window.open(url + '?mode=details#vout=' + e.data[1].vout);
} else {
this.router.navigate([url], { fragment: `vout=${e.data[0].vout}` });
this.router.navigate([url], { fragment: `vout=${e.data[1].vout}` });
}
});
}