bugfixes design

This commit is contained in:
Chneemann 2024-05-26 19:07:14 +02:00
parent 176e2cfa35
commit 54e766802f
3 changed files with 12 additions and 8 deletions

View file

@ -5,6 +5,7 @@ import {
ElementRef,
HostListener,
OnChanges,
OnInit,
SimpleChanges,
} from '@angular/core';
import { HeaderComponent } from '../../shared/components/header/header.component';
@ -39,13 +40,13 @@ import { SharedService } from '../../service/shared.service';
templateUrl: './main.component.html',
styleUrl: './main.component.scss',
})
export class MainComponent {
export class MainComponent implements OnInit {
constructor(
public userService: UserService,
public chatService: ChatService,
public channelService: ChannleService,
private route: Router,
private router: ActivatedRoute,
private router: Router,
private route: ActivatedRoute,
private elementRef: ElementRef,
public toggleAllBooleans: ToggleBooleanService,
private sharedService: SharedService
@ -68,7 +69,9 @@ export class MainComponent {
*/
ifUserLogin() {
if (this.userService.getCurrentUserId() === null) {
this.route.navigateByUrl('/login');
setTimeout(() => {
this.router.navigate(['/login']);
}, 0);
}
}
@ -76,8 +79,8 @@ export class MainComponent {
* Subscribes to route params and updates the current channel.
*/
routeUserId() {
if (this.router.params.subscribe()) {
this.router.params.subscribe((params) => {
if (this.route.params.subscribe()) {
this.route.params.subscribe((params) => {
this.currentChannel = params['id'];
});
}

View file

@ -45,8 +45,8 @@
<app-small-btn
class="switchLanguage"
[imgSrc]="'language.svg'"
[imgSize]="'32px'"
[btnSize]="'40px'"
[imgSize]="'24px'"
[btnSize]="'36px'"
[imgSize]="viewWidth > 570 ? '24px' : '17px'"
[btnSize]="viewWidth > 570 ? '36px' : '25px'"
[btnBgHoverColor]="'#edeefe'"

View file

@ -40,6 +40,7 @@ export class StartHeaderComponent {
* Initializes the component and decides whether to start animations based on the login service state.
*/
ngOnInit(): void {
this.updateViewWidth();
if (!this.loginService.getAnimationState()) {
this.triggerAnimations();
} else {