From dede6c3f0d6586199fb55754595c41ad4080428a Mon Sep 17 00:00:00 2001 From: Maiko Cunha Date: Sat, 29 Feb 2020 19:29:25 -0300 Subject: [PATCH] =?UTF-8?q?login=20automatico=20quando=20a=20aplica=C3=A7a?= =?UTF-8?q?o=20e=20iniciada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.html | 5 ----- src/app/app.component.ts | 32 +++++++++++++++++--------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index cfcd051..2bed0f4 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -17,11 +17,6 @@ Logo da Lightning Talk - - - diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c0439ab..b0a8a4e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { BroadcastService, MsalService } from '@azure/msal-angular'; import { OutlookSchedulerService } from './services/outlook-scheduler.service'; import { LightningTalk } from './model/lightning-talk'; @@ -34,21 +34,23 @@ export class AppComponent { if (this.isLogged()) { this.updateLoggedUserInfo(); - } - - this.broadcastService.subscribe("msal:loginSuccess", (payload) => { - this.updateLoggedUserInfo(); - }); - this.formLt = this.formBuilder.group({ - title: ['', Validators.required], - description: ['', Validators.required], - date: ['', Validators.required], - startTime: ['', [Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]], - endTime: ['', [ Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]], - tranmissionNeeds: [''], - technical: [false] - }, { validators: this.endTimeGreatherThanStartTimeValidator() }); + this.broadcastService.subscribe("msal:loginSuccess", (payload) => { + this.updateLoggedUserInfo(); + }); + + this.formLt = this.formBuilder.group({ + title: ['', Validators.required], + description: ['', Validators.required], + date: ['', Validators.required], + startTime: ['', [Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]], + endTime: ['', [ Validators.required, Validators.pattern(AppComponent.BR_TIME_VALIDATOR)]], + tranmissionNeeds: [''], + technical: [false] + }, { validators: this.endTimeGreatherThanStartTimeValidator() }); + } else { + this.logar(); + } } abrirCalendario(item){