Use relative pipe for pie chart click event

This commit is contained in:
nymkappa 2022-03-25 10:57:34 +09:00
parent 8114ffe1c8
commit b075fedd7c
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04
2 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,7 @@
</td>
<td class="pool text-left" [class]="widget ? 'widget' : ''">
<div class="tooltip-custom">
<a class="clear-link" [routerLink]="[('/mining/pool/' + block.extras.pool.id) | relativeUrl]">
<a class="clear-link" [routerLink]="['/mining/pool' | relativeUrl, block.extras.pool.id]">
<img width="25" height="25" src="{{ block.extras.pool['logo'] }}"
onError="this.src = './resources/mining-pools/default.svg'">
<span class="pool-name">{{ block.extras.pool.name }}</span>

View File

@ -10,6 +10,7 @@ import { StorageService } from '../..//services/storage.service';
import { MiningService, MiningStats } from '../../services/mining.service';
import { StateService } from '../../services/state.service';
import { chartColors, poolsColor } from 'src/app/app.constants';
import { RelativeUrlPipe } from 'src/app/shared/pipes/relative-url/relative-url.pipe';
@Component({
selector: 'app-pool-ranking',
@ -284,7 +285,8 @@ export class PoolRankingComponent implements OnInit {
return;
}
this.zone.run(() => {
this.router.navigate(['/mining/pool/', e.data.data]);
const url = new RelativeUrlPipe(this.stateService).transform(`/mining/pool/${e.data.data}`);
this.router.navigate([url]);
});
});
}