Compare commits

..

2 Commits

Author SHA1 Message Date
Igor Hrenowitsch Propisnov b0b3fa72e1 remove unused component 2024-07-18 22:53:08 +02:00
Igor Hrenowitsch Propisnov 635b30d33b Renaming 2024-07-18 22:52:49 +02:00
7 changed files with 5 additions and 43 deletions

View File

@ -6,8 +6,8 @@ const simpleLayoutRoutes: Routes = [
{ {
path: '', path: '',
loadComponent: () => loadComponent: () =>
import('./pages/register-root/register-root.component').then( import('./pages/welcome-root/welcome-root.component').then(
(m) => m.RegisterRootComponent (m) => m.WelcomeRootComponent
), ),
}, },
{ {

View File

@ -1,38 +0,0 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { SuccessDtoApiModel } from '../../api';
import { AuthService } from '../../shared/service';
@Component({
selector: 'app-foo',
standalone: true,
providers: [],
imports: [],
templateUrl: './home-root.component.html',
styleUrl: './home-root.component.scss',
})
export class HomeComponent implements OnInit {
public constructor(
private readonly authService: AuthService,
private readonly router: Router
) {}
public ngOnInit(): void {
this.authService.status().subscribe(
(response: SuccessDtoApiModel) => {
if (response.success) {
this.router.navigate(['/dashboard']);
}
},
(error: HttpErrorResponse) => {
if (error.status === 401) {
this.router.navigate(['welcome'], {
queryParams: { login: true },
});
}
}
);
}
}

View File

@ -67,11 +67,11 @@ type AuthAction = 'signin' | 'signup';
new ApiConfiguration({ withCredentials: true }), new ApiConfiguration({ withCredentials: true }),
}, },
], ],
templateUrl: './register-root.component.html', templateUrl: './welcome-root.component.html',
styleUrl: './register-root.component.scss', styleUrl: './welcome-root.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class RegisterRootComponent implements OnInit { export class WelcomeRootComponent implements OnInit {
public dialogBackgroundStyle: { 'background-image': string } | null = null; public dialogBackgroundStyle: { 'background-image': string } | null = null;
public leftBackgroundStyle: { 'background-image': string } | null = null; public leftBackgroundStyle: { 'background-image': string } | null = null;
public rightBackgroundStyle: { 'background-image': string } | null = null; public rightBackgroundStyle: { 'background-image': string } | null = null;