Fix navigation to use relative paths

This commit is contained in:
natsoni 2024-11-02 10:41:37 +01:00
parent e75f913af3
commit b3aed2f58b
No known key found for this signature in database
GPG Key ID: C65917583181743B
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import { WebsocketService } from '@app/services/websocket.service';
import { SeoService } from '@app/services/seo.service'; import { SeoService } from '@app/services/seo.service';
import { OpenGraphService } from '@app/services/opengraph.service'; import { OpenGraphService } from '@app/services/opengraph.service';
import { seoDescriptionNetwork } from '@app/shared/common.utils'; import { seoDescriptionNetwork } from '@app/shared/common.utils';
import { RelativeUrlPipe } from '@app/shared/pipes/relative-url/relative-url.pipe';
@Component({ @Component({
selector: 'app-blocks-list', selector: 'app-blocks-list',
@ -49,6 +50,7 @@ export class BlocksList implements OnInit {
private ogService: OpenGraphService, private ogService: OpenGraphService,
private route: ActivatedRoute, private route: ActivatedRoute,
private router: Router, private router: Router,
private relativeUrlPipe: RelativeUrlPipe,
@Inject(LOCALE_ID) private locale: string, @Inject(LOCALE_ID) private locale: string,
) { ) {
this.isMempoolModule = this.stateService.env.BASE_MODULE === 'mempool'; this.isMempoolModule = this.stateService.env.BASE_MODULE === 'mempool';
@ -182,7 +184,7 @@ export class BlocksList implements OnInit {
} }
pageChange(page: number): void { pageChange(page: number): void {
this.router.navigate(['blocks', page]); this.router.navigate([this.relativeUrlPipe.transform('/blocks/'), page]);
} }
trackByBlock(index: number, block: BlockExtended): number { trackByBlock(index: number, block: BlockExtended): number {

View File

@ -267,7 +267,7 @@ export class MempoolBlocksComponent implements OnInit, OnChanges, OnDestroy {
if (event.key === prevKey) { if (event.key === prevKey) {
if (this.mempoolBlocks[this.markIndex - 1]) { if (this.mempoolBlocks[this.markIndex - 1]) {
this.router.navigate([this.relativeUrlPipe.transform('mempool-block/'), this.markIndex - 1]); this.router.navigate([this.relativeUrlPipe.transform('/mempool-block/'), this.markIndex - 1]);
} else { } else {
const blocks = this.stateService.blocksSubject$.getValue(); const blocks = this.stateService.blocksSubject$.getValue();
for (const block of (blocks || [])) { for (const block of (blocks || [])) {