21 lines
589 B
TypeScript
21 lines
589 B
TypeScript
import { Component, inject } from '@angular/core';
|
|
import { Router, RouterLink, RouterOutlet } from '@angular/router';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
standalone: true,
|
|
imports: [RouterOutlet, RouterLink],
|
|
templateUrl: './app.component.html',
|
|
styleUrl: './app.component.css',
|
|
})
|
|
export class AppComponent {
|
|
private readonly router = inject(Router);
|
|
|
|
constructor() {
|
|
const shellRoute = document.body.dataset['wppShellRoute'];
|
|
if (shellRoute?.startsWith('/host') || shellRoute?.startsWith('/player')) {
|
|
void this.router.navigateByUrl(shellRoute);
|
|
}
|
|
}
|
|
}
|