From aab82c4dfb9dcee10dfc2b9d518feb22021d3bf5 Mon Sep 17 00:00:00 2001 From: Vincent BENOIT Date: Tue, 3 Jan 2023 13:54:29 +0100 Subject: [PATCH] correction bug affichage au chargement de la date et heure sur la page infos --- .../home/workspace/infos/infos.component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/components/home/workspace/infos/infos.component.ts b/src/app/components/home/workspace/infos/infos.component.ts index efce719..d5900d5 100644 --- a/src/app/components/home/workspace/infos/infos.component.ts +++ b/src/app/components/home/workspace/infos/infos.component.ts @@ -30,11 +30,21 @@ export class InfosComponent implements OnInit { private toast:ToastrService ) { } ngOnInit(): void { + this.bs.retreiveDatetime().subscribe( + (data:Datetime) => { + this.dateStr = data.today; + }, err => { + if(err.status == 401) { + this.router.navigateByUrl("/login"); + } else { + this.toast.error(err.error.description); + } + } + ); setInterval(() => { this.bs.retreiveDatetime().subscribe( (data:Datetime) => { this.dateStr = data.today; - console.log("=> retreive today: {}", this.today); }, err => { if(err.status == 401) { this.router.navigateByUrl("/login");