Skip to content

Commit

Permalink
fix(daffio): wrong index loaded after 404 and back navigation (#3339)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 authored Nov 4, 2024
1 parent 6d635c8 commit 618a630
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {
filter,
map,
Observable,
} from 'rxjs';
Expand All @@ -29,6 +30,7 @@ export class DaffioApiListPageComponent implements OnInit {

ngOnInit() {
this.apiList$ = this.route.data.pipe(
filter(Boolean),
map((data) => data.index),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
OnInit,
} from '@angular/core';
import {
filter,
map,
Observable,
switchMap,
Expand Down Expand Up @@ -35,6 +36,7 @@ export class DaffioDocsListContainer implements OnInit {
ngOnInit() {
this.docsList$ = this.route.route$.pipe(
switchMap((route) => route.data),
filter(Boolean),
map((data) => data.index),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
OnInit,
} from '@angular/core';
import {
filter,
map,
Observable,
switchMap,
Expand Down Expand Up @@ -35,6 +36,7 @@ export class DaffioDocsDesignListContainer implements OnInit {
ngOnInit() {
this.docsList$ = this.route.route$.pipe(
switchMap((route) => route.data),
filter(Boolean),
map((data) => data.index),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
OnInit,
} from '@angular/core';
import {
filter,
map,
Observable,
switchMap,
Expand Down Expand Up @@ -35,6 +36,7 @@ export class DaffioDocsPackageCardsContainer implements OnInit {
this.packagesList$ = this.route.route$.pipe(
switchMap((route) => route.data),
map((data) => data.index),
filter(Boolean),
map((guidesTree) => guidesTree.children.map((p) => ({
title: p.title,
path: `/${getPath(p)}`,
Expand Down

0 comments on commit 618a630

Please sign in to comment.