Skip to content

Commit

Permalink
chore(demo): fix re-creating main portal twice (#9130)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Sep 23, 2024
1 parent fa81919 commit 5c49413
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion projects/demo/src/modules/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {WA_LOCAL_STORAGE} from '@ng-web-apis/common';
import {ResizeObserverService} from '@ng-web-apis/resize-observer';
import {TuiDocLanguageSwitcher} from '@taiga-ui/addon-doc';
import {TuiSheetModule, TuiTextfieldControllerModule} from '@taiga-ui/legacy';
import {distinctUntilChanged, filter, map} from 'rxjs';
import {distinctUntilChanged, filter, map, startWith} from 'rxjs';

import {CustomHost} from '../customization/portals/examples/1/portal';
import {AbstractDemo, DEMO_PAGE_LOADED_PROVIDER} from './abstract.app';
Expand Down Expand Up @@ -59,8 +59,10 @@ export class App extends AbstractDemo implements OnInit {
protected readonly routes = DemoRoute;

protected readonly isLanding$ = this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
map(() => this.url === '' || this.url === '/'),
distinctUntilChanged(),
startWith(true),
);

public override async ngOnInit(): Promise<void> {
Expand Down

0 comments on commit 5c49413

Please sign in to comment.