diff --git a/src/app/shared/components/legal-information/help/help.component.ts b/src/app/shared/components/legal-information/help/help.component.ts index 437f902..de04075 100644 --- a/src/app/shared/components/legal-information/help/help.component.ts +++ b/src/app/shared/components/legal-information/help/help.component.ts @@ -14,6 +14,9 @@ import { BtnBackComponent } from '../../buttons/btn-back/btn-back.component'; export class HelpComponent { constructor(private location: Location) {} + /** + * Navigates back in the browser's history. + */ backClicked() { this.location.back(); } diff --git a/src/app/shared/components/legal-information/imprint/imprint.component.ts b/src/app/shared/components/legal-information/imprint/imprint.component.ts index e5ec453..2fd77b1 100644 --- a/src/app/shared/components/legal-information/imprint/imprint.component.ts +++ b/src/app/shared/components/legal-information/imprint/imprint.component.ts @@ -16,14 +16,29 @@ export class ImprintComponent { constructor(private location: Location, private router: Router) {} + /** + * OnInit lifecycle hook. + * + * Checks if the current route is '/login/privacy-policy' and sets + * `isRouteLogin` accordingly. + */ ngOnInit(): void { this.checkCurrentRoute(); } + /** + * Navigates back in the browser's history. + */ backClicked() { this.location.back(); } + /** + * Checks the current route and updates the `isRouteLogin` flag. + * + * This method retrieves the current URL from the router. If the URL + * matches '/login/imprint', it sets the `isRouteLogin` property to true. + */ checkCurrentRoute(): void { const currentUrl = this.router.url; if (currentUrl === '/login/imprint') { diff --git a/src/app/shared/components/legal-information/privacy-policy/privacy-policy.component.ts b/src/app/shared/components/legal-information/privacy-policy/privacy-policy.component.ts index fc2c492..976025d 100644 --- a/src/app/shared/components/legal-information/privacy-policy/privacy-policy.component.ts +++ b/src/app/shared/components/legal-information/privacy-policy/privacy-policy.component.ts @@ -16,14 +16,29 @@ export class PrivacyPolicyComponent implements OnInit { constructor(private location: Location, private router: Router) {} + /** + * OnInit lifecycle hook. + * + * Checks if the current route is '/login/privacy-policy' and sets + * `isRouteLogin` accordingly. + */ ngOnInit(): void { this.checkCurrentRoute(); } + /** + * Navigates back in the browser's history. + */ backClicked() { this.location.back(); } + /** + * Checks the current route and updates the `isRouteLogin` flag. + * + * This method retrieves the current URL from the router. If the URL + * matches '/login/privacy-policy', it sets the `isRouteLogin` property to true. + */ checkCurrentRoute(): void { const currentUrl = this.router.url; if (currentUrl === '/login/privacy-policy') {