From cf42e725cc5e803d00862b39b1e519ae45b1f3a0 Mon Sep 17 00:00:00 2001 From: Jan-Marlon Leibl Date: Wed, 26 Mar 2025 10:58:25 +0100 Subject: [PATCH 1/3] feat(home): add router to clear query parameters --- frontend/src/app/feature/home/home.component.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/feature/home/home.component.ts b/frontend/src/app/feature/home/home.component.ts index 88fe552..a55905d 100644 --- a/frontend/src/app/feature/home/home.component.ts +++ b/frontend/src/app/feature/home/home.component.ts @@ -5,7 +5,7 @@ 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'; +import { ActivatedRoute, Router } from '@angular/router'; @Component({ selector: 'app-homepage', @@ -18,10 +18,14 @@ export default class HomeComponent implements OnInit { isDepositModalOpen = false; isDepositSuccessful = false; - constructor(public route: ActivatedRoute) {} + constructor(public route: ActivatedRoute, public router: Router) {} ngOnInit() { this.isDepositSuccessful = this.route.snapshot.queryParams['success'] == 'true'; + + // Clear all query parameters without merging + this.router.navigate([], { queryParams: {} }); + if (this.isDepositSuccessful) { this.openDepositConfirmationModal(); } -- 2.47.2 From af90108b3bd535c06e41d52b627db59362e98d4f Mon Sep 17 00:00:00 2001 From: Jan-Marlon Leibl Date: Wed, 26 Mar 2025 11:00:43 +0100 Subject: [PATCH 2/3] refactor(home): remove unnecessary comment from code --- frontend/src/app/feature/home/home.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/app/feature/home/home.component.ts b/frontend/src/app/feature/home/home.component.ts index a55905d..211883c 100644 --- a/frontend/src/app/feature/home/home.component.ts +++ b/frontend/src/app/feature/home/home.component.ts @@ -23,7 +23,6 @@ export default class HomeComponent implements OnInit { ngOnInit() { this.isDepositSuccessful = this.route.snapshot.queryParams['success'] == 'true'; - // Clear all query parameters without merging this.router.navigate([], { queryParams: {} }); if (this.isDepositSuccessful) { -- 2.47.2 From ce17741e7231fc1fc30b47598cabc40b24fd749c Mon Sep 17 00:00:00 2001 From: Jan-Marlon Leibl Date: Wed, 26 Mar 2025 11:03:28 +0100 Subject: [PATCH 3/3] style(home): format constructor for better readability --- frontend/src/app/feature/home/home.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/feature/home/home.component.ts b/frontend/src/app/feature/home/home.component.ts index 211883c..5baf2a0 100644 --- a/frontend/src/app/feature/home/home.component.ts +++ b/frontend/src/app/feature/home/home.component.ts @@ -18,7 +18,10 @@ export default class HomeComponent implements OnInit { isDepositModalOpen = false; isDepositSuccessful = false; - constructor(public route: ActivatedRoute, public router: Router) {} + constructor( + public route: ActivatedRoute, + public router: Router + ) {} ngOnInit() { this.isDepositSuccessful = this.route.snapshot.queryParams['success'] == 'true'; -- 2.47.2