From 80ae2d0b5fc2e45673cee2ce3ac70d83dcb92f16 Mon Sep 17 00:00:00 2001 From: Domenico Gemoli Date: Thu, 19 Dec 2024 16:43:20 +0100 Subject: [PATCH] portalicious: fix navigation post create-payment AB#32308 After creating a new payment, the user should be redirected to the payment page. This was not working. This does not address the originally reported bug in the linked bug item, but that is because the bug is _actually_ expected behaviour. --- .../create-payment/create-payment.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/interfaces/Portalicious/src/app/pages/project-payments/components/create-payment/create-payment.component.ts b/interfaces/Portalicious/src/app/pages/project-payments/components/create-payment/create-payment.component.ts index 3ed574852f..428b265334 100644 --- a/interfaces/Portalicious/src/app/pages/project-payments/components/create-payment/create-payment.component.ts +++ b/interfaces/Portalicious/src/app/pages/project-payments/components/create-payment/create-payment.component.ts @@ -177,7 +177,14 @@ export class CreatePaymentComponent { return; } - this.dialogVisible.set(false); + // Do not set dialogVisible to false here, otherwise the addCurrentStepToQueryParams + // effect will be triggered, blocking the user from navigating away + // this.dialogVisible.set(false); + + await this.paymentApiService.invalidateCache( + this.projectId, + signal(paymentId), + ); await this.router.navigate([ '/', @@ -190,8 +197,6 @@ export class CreatePaymentComponent { this.toastService.showToast({ detail: $localize`Payment created.`, }); - - void this.paymentApiService.invalidateCache(this.projectId); }, onError: (error) => { this.toastService.showToast({