Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍
TypeScript angularetffinancefintechghostfoliohacktoberfestinvestingnestjsosspersonal-financeportfolioprismasoftwarestocktrackertradingtypescriptwealth-managementweb
Task/eliminate OnDestroy lifecycle hook from webauthn page (#6429)
slegarraga8c83742d9c74
diff --git a/apps/client/src/app/pages/webauthn/webauthn-page.component.ts b/apps/client/src/app/pages/webauthn/webauthn-page.component.tsindex 74631eeca9..8e7e58fd14 100644--- a/apps/client/src/app/pages/webauthn/webauthn-page.component.ts+++ b/apps/client/src/app/pages/webauthn/webauthn-page.component.ts@@ -2,12 +2,16 @@ import { TokenStorageService } from '@ghostfolio/client/services/token-storage.simport { WebAuthnService } from '@ghostfolio/client/services/web-authn.service';import { GfLogoComponent } from '@ghostfolio/ui/logo';-import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core';+import {+ ChangeDetectorRef,+ Component,+ DestroyRef,+ OnInit+} from '@angular/core';+import { takeUntilDestroyed } from '@angular/core/rxjs-interop';import { MatButtonModule } from '@angular/material/button';import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';import { Router } from '@angular/router';-import { Subject } from 'rxjs';-import { takeUntil } from 'rxjs/operators';@Component({host: { class: 'page' },@@ -16,13 +20,12 @@ import { takeUntil } from 'rxjs/operators';styleUrls: ['./webauthn-page.scss'],templateUrl: './webauthn-page.html'})-export class GfWebauthnPageComponent implements OnDestroy, OnInit {+export class GfWebauthnPageComponent implements OnInit {public hasError = false;- private unsubscribeSubject = new Subject<void>();-public constructor(private changeDetectorRef: ChangeDetectorRef,+ private destroyRef: DestroyRef,private router: Router,private tokenStorageService: TokenStorageService,private webAuthnService: WebAuthnService@@ -35,7 +38,7 @@ export class GfWebauthnPageComponent implements OnDestroy, OnInit {public deregisterDevice() {this.webAuthnService.deregister()- .pipe(takeUntil(this.unsubscribeSubject))+ .pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {this.router.navigate(['/']);});@@ -46,7 +49,7 @@ export class GfWebauthnPageComponent implements OnDestroy, OnInit {this.webAuthnService.login()- .pipe(takeUntil(this.unsubscribeSubject))+ .pipe(takeUntilDestroyed(this.destroyRef)).subscribe(({ authToken }) => {this.tokenStorageService.saveToken(authToken, false);@@ -59,9 +62,4 @@ export class GfWebauthnPageComponent implements OnDestroy, OnInit {});}-- public ngOnDestroy() {- this.unsubscribeSubject.next();- this.unsubscribeSubject.complete();- }}