Main view improvements

This commit is contained in:
2022-12-06 16:28:59 +01:00
parent 41e6e58128
commit 97f74c9362
19 changed files with 180 additions and 24 deletions

View File

@@ -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);
}