Main view improvements
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, NgZone, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import jwt_decode from "jwt-decode";
|
||||
import { AuthService } from 'src/app/auth/auth.service';
|
||||
@@ -16,7 +16,8 @@ export class LoginPageComponent implements OnInit {
|
||||
constructor(
|
||||
private data$: DataService,
|
||||
private router$: Router,
|
||||
private auth$: AuthService
|
||||
private auth$: AuthService,
|
||||
private ngZone$: NgZone
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -51,10 +52,12 @@ export class LoginPageComponent implements OnInit {
|
||||
avatar: responsePayload.picture
|
||||
});
|
||||
// this.auth$.loadDbUser();
|
||||
this.router$.navigate(['/app']);
|
||||
console.log("USer", this.data$.currentUser);
|
||||
await this.auth$.getAPIToken(response.credential);
|
||||
this.auth$.loadDbUser();
|
||||
// this.auth$.loadDbUser();
|
||||
this.ngZone$.run(() => {
|
||||
this.router$.navigate(['/app']);
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Get user error', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user