Skip to content

Commit

Permalink
Merge pull request #26 from Sybit-Education/fix/header-logo-login
Browse files Browse the repository at this point in the history
fix: Check login
  • Loading branch information
Der-Zauberer authored Aug 3, 2023
2 parents f8c4518 + 0499578 commit a7ab6af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<nav class="navbar fixed-top navbar-expand-lg bg-light">
<div class="container-fluid">
<a class="navbar-brand" routerLink="/">
<img alt="Sygotchi-logo" class="logo" src="assets/images/sygotchi-logo.png">
<a class="navbar-brand" >
<img (click)="checkLogin()" alt="Sygotchi-logo" class="logo" src="assets/images/sygotchi-logo.png">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggler" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
Expand Down
11 changes: 11 additions & 0 deletions src/app/header/header.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Component } from '@angular/core';
import { AuthService } from '../services/auth.service';
import { Router } from '@angular/router';

@Component({
selector: 'app-header',
Expand All @@ -7,4 +9,13 @@ import { Component } from '@angular/core';
})
export class HeaderComponent {

constructor(public route: Router){}

checkLogin(){
if(localStorage.token){
this.route.navigate(['/sleep'])
}else{
this.route.navigate(['/auth'])
}
}
}
1 change: 0 additions & 1 deletion src/app/sygotchi-clean/sygotchi-clean.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class SygotchiCleanComponent implements OnInit {
ngOnInit(): void {
this.store.select(selectSygotchi).subscribe(SyGotchi => {
this.isDirty = SyGotchi.dirty
console.log(SyGotchi.dirty)
this.sygotchi = SyGotchi
})
}
Expand Down

0 comments on commit a7ab6af

Please sign in to comment.