Browse Source

Unsubscribe subscriptions

pull/117/head
Thomas 4 years ago
parent
commit
10de56ab9c
  1. 5
      apps/client/src/app/app.component.ts
  2. 5
      apps/client/src/app/pages/about/about-page.component.ts
  3. 10
      apps/client/src/app/pages/account/account-page.component.ts
  4. 5
      apps/client/src/app/pages/accounts/accounts-page.component.ts
  5. 5
      apps/client/src/app/pages/admin/admin-page.component.ts
  6. 5
      apps/client/src/app/pages/analysis/analysis-page.component.ts
  7. 5
      apps/client/src/app/pages/home/home-page.component.ts
  8. 5
      apps/client/src/app/pages/pricing/pricing-page.component.ts
  9. 5
      apps/client/src/app/pages/transactions/transactions-page.component.ts
  10. 5
      apps/client/src/app/pages/zen/zen-page.component.ts

5
apps/client/src/app/app.component.ts

@ -73,7 +73,10 @@ export class AppComponent implements OnDestroy, OnInit {
this.isLoggedIn = !!this.tokenStorageService.getToken();
if (this.isLoggedIn) {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.canCreateAccount = hasPermission(

5
apps/client/src/app/pages/about/about-page.component.ts

@ -44,7 +44,10 @@ export class AboutPageComponent implements OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.cd.markForCheck();

10
apps/client/src/app/pages/account/account-page.component.ts

@ -50,7 +50,10 @@ export class AccountPageComponent implements OnDestroy, OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.hasPermissionToUpdateUserSettings = hasPermission(
@ -82,7 +85,10 @@ export class AccountPageComponent implements OnDestroy, OnInit {
.subscribe(() => {
this.userService.remove();
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.cd.markForCheck();

5
apps/client/src/app/pages/accounts/accounts-page.component.ts

@ -81,7 +81,10 @@ export class AccountsPageComponent implements OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.hasPermissionToCreateAccount = hasPermission(

5
apps/client/src/app/pages/admin/admin-page.component.ts

@ -49,7 +49,10 @@ export class AdminPageComponent implements OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
});
});

5
apps/client/src/app/pages/analysis/analysis-page.component.ts

@ -85,7 +85,10 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.cd.markForCheck();

5
apps/client/src/app/pages/home/home-page.component.ts

@ -82,7 +82,10 @@ export class HomePageComponent implements OnDestroy, OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.hasPermissionToAccessFearAndGreedIndex = hasPermission(

5
apps/client/src/app/pages/pricing/pricing-page.component.ts

@ -40,7 +40,10 @@ export class PricingPageComponent implements OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.cd.markForCheck();

5
apps/client/src/app/pages/transactions/transactions-page.component.ts

@ -81,7 +81,10 @@ export class TransactionsPageComponent implements OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.hasPermissionToCreateOrder = hasPermission(

5
apps/client/src/app/pages/zen/zen-page.component.ts

@ -43,7 +43,10 @@ export class ZenPageComponent implements OnDestroy, OnInit {
.onChangeHasToken()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(() => {
this.userService.get().subscribe((user) => {
this.userService
.get()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe((user) => {
this.user = user;
this.hasPermissionToReadForeignPortfolio = hasPermission(

Loading…
Cancel
Save