29 lines
817 B
TypeScript
29 lines
817 B
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { Rayconnect } from '../services/rayconnect/rayconnect.service';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls: ['./app.component.scss']
|
|
})
|
|
export class AppComponent implements OnInit {
|
|
public splash: boolean = true;
|
|
constructor(private rayconnect: Rayconnect, private router: Router) { }
|
|
|
|
async ngOnInit(): Promise<void> {
|
|
await this.rayconnect.init()
|
|
|
|
if (this.rayconnect.user.uid != "guest") {
|
|
await this.rayconnect.setProfile();
|
|
if ((this.router.url === "/") || (this.router.url === "/auth")) {
|
|
this.router.navigate(["/panel/volunteers"])
|
|
}
|
|
|
|
} else {
|
|
this.router.navigate(["/auth"])
|
|
}
|
|
this.splash = false;
|
|
}
|
|
}
|