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,
|
ElementRef,
|
||||||
HostListener,
|
HostListener,
|
||||||
OnChanges,
|
OnChanges,
|
||||||
|
OnInit,
|
||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { HeaderComponent } from '../../shared/components/header/header.component';
|
import { HeaderComponent } from '../../shared/components/header/header.component';
|
||||||
|
|
@ -39,13 +40,13 @@ import { SharedService } from '../../service/shared.service';
|
||||||
templateUrl: './main.component.html',
|
templateUrl: './main.component.html',
|
||||||
styleUrl: './main.component.scss',
|
styleUrl: './main.component.scss',
|
||||||
})
|
})
|
||||||
export class MainComponent {
|
export class MainComponent implements OnInit {
|
||||||
constructor(
|
constructor(
|
||||||
public userService: UserService,
|
public userService: UserService,
|
||||||
public chatService: ChatService,
|
public chatService: ChatService,
|
||||||
public channelService: ChannleService,
|
public channelService: ChannleService,
|
||||||
private route: Router,
|
private router: Router,
|
||||||
private router: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private elementRef: ElementRef,
|
private elementRef: ElementRef,
|
||||||
public toggleAllBooleans: ToggleBooleanService,
|
public toggleAllBooleans: ToggleBooleanService,
|
||||||
private sharedService: SharedService
|
private sharedService: SharedService
|
||||||
|
|
@ -68,7 +69,9 @@ export class MainComponent {
|
||||||
*/
|
*/
|
||||||
ifUserLogin() {
|
ifUserLogin() {
|
||||||
if (this.userService.getCurrentUserId() === null) {
|
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.
|
* Subscribes to route params and updates the current channel.
|
||||||
*/
|
*/
|
||||||
routeUserId() {
|
routeUserId() {
|
||||||
if (this.router.params.subscribe()) {
|
if (this.route.params.subscribe()) {
|
||||||
this.router.params.subscribe((params) => {
|
this.route.params.subscribe((params) => {
|
||||||
this.currentChannel = params['id'];
|
this.currentChannel = params['id'];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@
|
||||||
<app-small-btn
|
<app-small-btn
|
||||||
class="switchLanguage"
|
class="switchLanguage"
|
||||||
[imgSrc]="'language.svg'"
|
[imgSrc]="'language.svg'"
|
||||||
[imgSize]="'32px'"
|
[imgSize]="'24px'"
|
||||||
[btnSize]="'40px'"
|
[btnSize]="'36px'"
|
||||||
[imgSize]="viewWidth > 570 ? '24px' : '17px'"
|
[imgSize]="viewWidth > 570 ? '24px' : '17px'"
|
||||||
[btnSize]="viewWidth > 570 ? '36px' : '25px'"
|
[btnSize]="viewWidth > 570 ? '36px' : '25px'"
|
||||||
[btnBgHoverColor]="'#edeefe'"
|
[btnBgHoverColor]="'#edeefe'"
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ export class StartHeaderComponent {
|
||||||
* Initializes the component and decides whether to start animations based on the login service state.
|
* Initializes the component and decides whether to start animations based on the login service state.
|
||||||
*/
|
*/
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.updateViewWidth();
|
||||||
if (!this.loginService.getAnimationState()) {
|
if (!this.loginService.getAnimationState()) {
|
||||||
this.triggerAnimations();
|
this.triggerAnimations();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue