Merge pull request #5259 from mempool/mononaut/fix-auth-refresh

fix auth refresh race condition
This commit is contained in:
softsimon 2024-07-02 22:11:34 +09:00 committed by GitHub
commit 46e8f6137c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();