Skip to content

Commit

Permalink
corrigir condição de entrada
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciusjps committed Oct 27, 2018
1 parent 83a2c4a commit 61bf87d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/comentarios/comentarios.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ export class ComentariosComponent implements OnInit {

private checkCard() {
const user = this.controller.getUserLogado();
if (this.id != null && user != null) {
let email = '';
if (this.id != null) {
this.getCard(this.id)
.then(data => {
if (data.privacy || data.author === user.getEmail()) {
if (user != null) {
email = user.getEmail();
}
if (data.privacy || data.author === email) {
const card = new Card(data.id, data.discipline, data.question, data.answer, data.privacy, data.author, data.image);
this.card = card;
} else {
Expand Down

0 comments on commit 61bf87d

Please sign in to comment.