bugfixes design
This commit is contained in:
parent
176e2cfa35
commit
54e766802f
3 changed files with 12 additions and 8 deletions
|
|
@ -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'];
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'"
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue