diff --git a/frontend/src/app/feature/home/home.component.html b/frontend/src/app/feature/home/home.component.html
index ace0c10..e8b3430 100644
--- a/frontend/src/app/feature/home/home.component.html
+++ b/frontend/src/app/feature/home/home.component.html
@@ -71,7 +71,7 @@
-
+
Letzte Transaktionen
diff --git a/frontend/src/app/feature/home/home.component.ts b/frontend/src/app/feature/home/home.component.ts
index c9761da..f1e2f17 100644
--- a/frontend/src/app/feature/home/home.component.ts
+++ b/frontend/src/app/feature/home/home.component.ts
@@ -1,10 +1,11 @@
-import { ChangeDetectionStrategy, Component } from '@angular/core';
+import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
import { NavbarComponent } from '../../shared/components/navbar/navbar.component';
import { CurrencyPipe, NgFor } from '@angular/common';
import { Game } from '../../model/Game';
import { Transaction } from '../../model/Transaction';
import { DepositComponent } from '../deposit/deposit.component';
import {ConfirmationComponent} from "../../shared/components/confirmation/confirmation.component";
+import {ActivatedRoute} from "@angular/router";
@Component({
selector: 'app-homepage',
@@ -13,9 +14,18 @@ import {ConfirmationComponent} from "../../shared/components/confirmation/confir
templateUrl: './home.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
-export default class HomeComponent {
+export default class HomeComponent implements OnInit {
isDepositModalOpen = false;
- isDepositSuccessful = true;
+ isDepositSuccessful = false;
+
+ constructor(public route: ActivatedRoute) {}
+
+ ngOnInit() {
+ this.isDepositSuccessful = this.route.snapshot.queryParams['success'] == 'true';
+ if (this.isDepositSuccessful) {
+ this.openDepositConfirmationModal();
+ }
+ }
featuredGames: Game[] = [
{
@@ -52,26 +62,7 @@ export default class HomeComponent {
allGames: Game[] = [...this.featuredGames];
- recentTransactions: Transaction[] = [
- {
- id: '1',
- type: 'Deposit',
- amount: 100.0,
- date: '2024-03-20',
- },
- {
- id: '2',
- type: 'Withdrawal',
- amount: -50.0,
- date: '2024-03-19',
- },
- {
- id: '3',
- type: 'Bonus',
- amount: 25.0,
- date: '2024-03-18',
- },
- ];
+ recentTransactions: Transaction[] = [];
openDepositModal() {
this.isDepositModalOpen = true;
@@ -80,10 +71,10 @@ export default class HomeComponent {
this.isDepositModalOpen = false;
}
- openDepositSuccessfulModal() {
+ openDepositConfirmationModal() {
this.isDepositSuccessful = true;
}
- closeDepositSuccessfulModal() {
+ closeDepositConfirmationModal() {
this.isDepositSuccessful = false;
}
}