From ec2ab174de4daded43f66c0a02fe138cc3c43cc4 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Tue, 2 Jul 2024 13:08:20 +0000 Subject: [PATCH] fix auth refresh race condition --- .../accelerate-checkout.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index d38355fde..460ae25fd 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -120,10 +120,14 @@ export class AccelerateCheckout implements OnInit, OnDestroy { ngOnInit() { this.authSubscription$ = this.authService.getAuth$().subscribe((auth) => { - this.auth = auth; - this.estimate = null; - this.error = null; - this.moveToStep('summary'); + if (this.auth?.user?.userId !== auth?.user?.userId) { + this.auth = auth; + this.estimate = null; + this.error = null; + this.moveToStep('summary'); + } else { + this.auth = auth; + } }); this.authService.refreshAuth$().subscribe();