Merge pull request #5625 from mempool/natsoni/fix-url-nav

Fix navigation to use relative paths
This commit is contained in:
softsimon 2024-11-09 00:08:52 +07:00 committed by GitHub
commit 136e80e5cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 { OpenGraphService } from '@app/services/opengraph.service';
import { seoDescriptionNetwork } from '@app/shared/common.utils';
import { RelativeUrlPipe } from '@app/shared/pipes/relative-url/relative-url.pipe';
@Component({
selector: 'app-blocks-list',
@ -49,6 +50,7 @@ export class BlocksList implements OnInit {
private ogService: OpenGraphService,
private route: ActivatedRoute,
private router: Router,
private relativeUrlPipe: RelativeUrlPipe,
@Inject(LOCALE_ID) private locale: string,
) {
this.isMempoolModule = this.stateService.env.BASE_MODULE === 'mempool';
@ -182,7 +184,7 @@ export class BlocksList implements OnInit {
}
pageChange(page: number): void {
this.router.navigate(['blocks', page]);
this.router.navigate([this.relativeUrlPipe.transform('/blocks/'), page]);
}
trackByBlock(index: number, block: BlockExtended): number {

View File

@ -267,7 +267,7 @@ export class MempoolBlocksComponent implements OnInit, OnChanges, OnDestroy {
if (event.key === prevKey) {
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 {
const blocks = this.stateService.blocksSubject$.getValue();
for (const block of (blocks || [])) {