-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: images minimized * chore: refactored name * chore: unified messages * chore: names refactored * fix: remove console.logs * chore: layout optimized * feat: add more mood reaction * chore: redirect to login if backend requires
- Loading branch information
Showing
33 changed files
with
145 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
<div class="message"> | ||
<div *ngIf="showMessage"> | ||
<span class="message"> {{message.text}} </span> | ||
</div> | ||
</div> | ||
<button class="btn btn-primary w-100" (click)="clean()"> | ||
<ngb-alert *ngIf="showMessage" [dismissible]="false"> | ||
{{message.text}} | ||
</ngb-alert> | ||
|
||
<button class="btn btn-primary w-100" type="button" (click)="clean()"> | ||
<i class="fa-solid fa-bath"></i> | ||
Waschen | ||
</button> | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
.message{ | ||
height: 24px; | ||
} | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
<div class="message"> | ||
<div *ngIf="showMessage"> | ||
<span class="message"> {{message.text}} </span> | ||
</div> | ||
</div> | ||
<button class="btn btn-primary w-100" (click)="train()"> | ||
<ngb-alert *ngIf="showMessage" [dismissible]="false"> | ||
{{message.text}} | ||
</ngb-alert> | ||
<button class="btn btn-primary w-100" type="button" (click)="train()"> | ||
<i class="fa-solid fa-heart"></i> | ||
Trainieren | ||
</button> | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +0,0 @@ | ||
.btn{ | ||
margin: 2px; | ||
width: 48.5%; | ||
} | ||
.message{ | ||
height: 24px; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
<div class="message"> | ||
<div *ngIf="showMessage"> | ||
<span class="message"> {{message.text}} </span> | ||
</div> | ||
</div> | ||
<ngb-alert *ngIf="showMessage" [dismissible]="false"> | ||
{{message.text}} | ||
</ngb-alert> | ||
|
||
<button class="btn btn-primary" (click)="feed()"> | ||
<button class="btn btn-primary" type="button" (click)="feed()"> | ||
<i class="fa-solid fa-cutlery"></i> | ||
Füttern | ||
</button> | ||
<button class="btn btn-primary" (click)="drink()"> | ||
<button class="btn btn-primary" type="button" (click)="drink()"> | ||
<i class="fa-solid fa-beer"></i> | ||
Trinken | ||
</button> | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
.btn{ | ||
margin: 2px; | ||
width: 48.5%; | ||
width: 48%; | ||
} | ||
.message{ | ||
height: 24px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,30 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpInterceptor, HttpRequest, HttpHandler } from '@angular/common/http'; | ||
import { HttpInterceptor, HttpRequest, HttpHandler, HttpErrorResponse } from '@angular/common/http'; | ||
import { catchError, throwError } from 'rxjs'; | ||
import { Router } from '@angular/router'; | ||
|
||
@Injectable() | ||
export class AuthInterceptor implements HttpInterceptor { | ||
|
||
constructor(private router: Router) {} | ||
|
||
intercept(request: HttpRequest<any>, next: HttpHandler) { | ||
const authToken = sessionStorage.getItem('token'); | ||
if (authToken) { | ||
request = request.clone({ | ||
headers: request.headers.set('Authorization', `Bearer ${authToken}`) | ||
}); | ||
} | ||
return next.handle(request); | ||
return next.handle(request).pipe( | ||
catchError((error: HttpErrorResponse) => { | ||
if (error.status === 401) { | ||
// Wenn ein 401-Fehler auftritt, leiten Sie den Benutzer zur Anmeldeseite um | ||
this.router.navigate(['/auth']); | ||
} | ||
|
||
// Andernfalls lassen Sie den Fehler weiterhin durch | ||
return throwError(error); | ||
}) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.