<commit_before>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

import { UserService } from './user.service';
import { AddressService } from './address.service';
import { Address } from './address';

@Component({
  selector: 'address-list',
  template: `
    <h2>Endereços</h2>
    <address-form></address-form>
    <span *ngIf="!addresses">Carregando...</span>
    <ul *ngIf="addresses">
      <li *ngFor="let address of addresses">
        <address [address]="address"></address>
      </li>
    </ul>
  `,
  styles: ['']
})
export class AddressListComponent implements OnInit {
  addresses: Address[];

  constructor(private router: Router, private userService: UserService, private addressService: AddressService) { }

  ngOnInit(): void {
    if (!this.userService.isLogged()) {
      this.router.navigateByUrl('login');
    } else {
      this.getAddresses();
    }
  }

  getAddresses(): void {
    this.addresses = this.addressService.addresses;
    this.addressService.update();
  }
}<commit_msg>Mensagem de nenhum endereço encontrado<commit_after>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

import { UserService } from './user.service';
import { AddressService } from './address.service';
import { Address } from './address';

@Component({
  selector: 'address-list',
  template: `
    <h2>Endereços</h2>
    <address-form></address-form>
    <p *ngIf="!addresses">Carregando...</p>
    <ul *ngIf="addresses">
      <li *ngFor="let address of addresses">
        <address [address]="address"></address>
      </li>
    </ul>
    <p *ngIf="addresses && !addresses.length">Nenhum endereço encontrado</p>
  `,
  styles: ['']
})
export class AddressListComponent implements OnInit {
  addresses: Address[];

  constructor(private router: Router, private userService: UserService, private addressService: AddressService) { }

  ngOnInit(): void {
    if (!this.userService.isLogged()) {
      this.router.navigateByUrl('login');
    } else {
      this.getAddresses();
    }
  }

  getAddresses(): void {
    this.addresses = this.addressService.addresses;
    this.addressService.update();
  }
}
{'fraction_non_alphanumeric': 0.16074681238615665, 'fraction_numerical': 0.0018214936247723133, 'mean_word_length': 3.724731182795699, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4312305', 'n_tokens_mistral': 686, 'n_tokens_neox': 682, 'n_words': 147}