aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/dashboard/dashboard.component.ts
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-03-31 15:09:23 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-03-31 15:09:23 -0400
commit9f31fea81818dae21f67b23a6004a3ca369f8e0d (patch)
tree5e052c399cc102af804d86de8695434b8f5ab7f0 /ufund-ui/src/app/components/dashboard/dashboard.component.ts
parent2031579ce6033fbe67a78b66d3da2ee6872748de (diff)
downloadJellySolutions-9f31fea81818dae21f67b23a6004a3ca369f8e0d.tar.gz
JellySolutions-9f31fea81818dae21f67b23a6004a3ca369f8e0d.tar.bz2
JellySolutions-9f31fea81818dae21f67b23a6004a3ca369f8e0d.zip
Added check to prevent redirect to login page
Diffstat (limited to 'ufund-ui/src/app/components/dashboard/dashboard.component.ts')
-rw-r--r--ufund-ui/src/app/components/dashboard/dashboard.component.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.ts b/ufund-ui/src/app/components/dashboard/dashboard.component.ts
index 165c7ba..49d93bf 100644
--- a/ufund-ui/src/app/components/dashboard/dashboard.component.ts
+++ b/ufund-ui/src/app/components/dashboard/dashboard.component.ts
@@ -27,7 +27,7 @@ export class DashboardComponent implements OnInit{
ngOnInit() {
let user = this.authService.getCurrentUser()
- if(!user) {
+ if(!localStorage.getItem("credential") && !user) {
this.router.navigate(['/login'])
return
}
@@ -35,7 +35,7 @@ export class DashboardComponent implements OnInit{
firstValueFrom(this.cupboardService.getNeeds()).then(r => {
this.topNeeds = r.sort((a, b) => b.current - a.current)
this.almostThere = r.sort((a, b) => a.current/a.maxGoal - b.current/b.maxGoal)
- this.inBasket = r.filter(n => n.id in user?.basket)
+ this.inBasket = r.filter(n => n.id in user!.basket)
})
}