Skip to content

Commit

Permalink
fix: new console errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSteppacher committed Aug 4, 2023
1 parent 13d4698 commit 7a6214a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions src/app/bedroom/bedroom.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@ export class BedroomComponent implements OnInit{
this.store.select(selectSygotchi)
.subscribe(
syGotchi => {
this.isAsleep = syGotchi.sleeping
if(syGotchi) {
this.isAsleep = syGotchi.sleeping
}
}
)
}
left(){
if(this.isAsleep == false){
if(!this.isAsleep){
this.router.navigate(['/bathroom'])
}
}
right(){
if(this.isAsleep == false){
if(!this.isAsleep){
this.router.navigate(['/gym'])
}
}
}
}
6 changes: 3 additions & 3 deletions src/app/gym-function/gym-function.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import { SyGotchi } from '../entities/syGotchi';
import { ActionsService } from '../services/actions.service';
import { Store } from '@ngrx/store';
Expand All @@ -16,6 +16,7 @@ export class GymFunctionComponent implements OnInit {
message = {text: '', error: false}
sygotchi: SyGotchi
showMessage: boolean = false
cooldown: number

constructor(private actionsService: ActionsService, private store: Store) {}

Expand Down Expand Up @@ -57,9 +58,8 @@ export class GymFunctionComponent implements OnInit {
this.message.error = true
this.message.text = 'Dein Sygotchi ist zu müde und kann nicht mehr trainieren.'
this.messageHandler()
})
}
}
}

messageHandler() {
this.showMessage = true
Expand Down
6 changes: 3 additions & 3 deletions src/app/needs/needs.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="center">
<div class="row w-100">
<div class="text-center h3">
<div class="text-center h3" *ngIf="sygotchi">
<a>{{sygotchi.name}}</a>
</div>
<div class="col-6 mb-3">
Expand Down Expand Up @@ -35,8 +35,8 @@
</span>
</label>
<br>
<label>
<span>Score:
<label>Score:
<span *ngIf="sygotchi">
{{ sygotchi.score}}
<i class="fa-solid fa-bank"></i>
</span>
Expand Down

0 comments on commit 7a6214a

Please sign in to comment.