From 011c6d7c8c470181ffa20cc39c9cba19f3d3695c Mon Sep 17 00:00:00 2001 From: adam_unchained Date: Thu, 20 Jul 2023 08:29:31 -0700 Subject: [PATCH] fixed member loading page --- src/app/pages/member/pages/nfts/nfts.page.ts | 40 +++++++++---------- .../pages/spaces/member-spaces.component.ts | 10 +++-- .../pages/member/pages/tokens/tokens.page.ts | 12 +++--- .../pages/transactions/transactions.page.ts | 10 ++--- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/src/app/pages/member/pages/nfts/nfts.page.ts b/src/app/pages/member/pages/nfts/nfts.page.ts index aea02c7..3d76ac3 100644 --- a/src/app/pages/member/pages/nfts/nfts.page.ts +++ b/src/app/pages/member/pages/nfts/nfts.page.ts @@ -45,29 +45,29 @@ export class NFTsPage implements OnInit { this.isDepositNftVisible = true; this.cd.markForCheck(); } - }); - this.data.member$.pipe(untilDestroyed(this)).subscribe((m) => { - if (m) { - this.filterStorageService.memberNftsFitlers$.next({ - sortBy: 'nft_soldOn_desc', - refinementList: { - ...this.filterStorageService.memberNftsFitlers$.value.refinementList, - owner: [m.uid], - }, - }); + this.data.member$.pipe(untilDestroyed(this)).subscribe((m) => { + if (m) { + this.filterStorageService.memberNftsFitlers$.next({ + sortBy: 'nft_soldOn_desc', + refinementList: { + ...this.filterStorageService.memberNftsFitlers$.value.refinementList, + owner: [m.uid], + }, + }); - this.config = { - indexName: COL.NFT, - searchClient: this.algoliaService.searchClient, - initialUiState: { - nft: this.filterStorageService.memberNftsFitlers$.value, - }, - }; + this.config = { + indexName: COL.NFT, + searchClient: this.algoliaService.searchClient, + initialUiState: { + nft: this.filterStorageService.memberNftsFitlers$.value, + }, + }; - // Algolia change detection bug fix - setInterval(() => this.cd.markForCheck(), 200); - } + // Algolia change detection bug fix + setInterval(() => this.cd.markForCheck(), 200); + } + }); }); } diff --git a/src/app/pages/member/pages/spaces/member-spaces.component.ts b/src/app/pages/member/pages/spaces/member-spaces.component.ts index 938ccdc..4b230f2 100644 --- a/src/app/pages/member/pages/spaces/member-spaces.component.ts +++ b/src/app/pages/member/pages/spaces/member-spaces.component.ts @@ -5,6 +5,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { DataService } from '@pages/member/services/data.service'; import { HelperService } from '@pages/member/services/helper.service'; import { Space } from '@build-5/interfaces'; +import { ActivatedRoute } from '@angular/router'; @UntilDestroy() @Component({ @@ -23,6 +24,7 @@ export class MemberSpacesComponent implements OnInit { public data: DataService, public helper: HelperService, public deviceService: DeviceService, + private route: ActivatedRoute, ) { this.spaceForm = new FormGroup({ space: new FormControl(''), @@ -31,9 +33,11 @@ export class MemberSpacesComponent implements OnInit { } ngOnInit(): void { - this.spaceForm.controls.space.valueChanges - .pipe(untilDestroyed(this)) - .subscribe(this.onSearchValueChange.bind(this)); + this.route.params.subscribe(() => { + this.spaceForm.controls.space.valueChanges + .pipe(untilDestroyed(this)) + .subscribe(this.onSearchValueChange.bind(this)); + }); } public onSearchValueChange(): void { diff --git a/src/app/pages/member/pages/tokens/tokens.page.ts b/src/app/pages/member/pages/tokens/tokens.page.ts index 42da339..6a13fe8 100644 --- a/src/app/pages/member/pages/tokens/tokens.page.ts +++ b/src/app/pages/member/pages/tokens/tokens.page.ts @@ -131,14 +131,14 @@ export class TokensPage implements OnInit, OnDestroy { if (obj?.tab === 'staking') { this.handleFilterChange(FilterOptions.STAKING); } - }); - this.data.member$?.pipe(untilDestroyed(this)).subscribe((obj) => { - if (obj) { - this.listen(); - } + this.data.member$?.pipe(untilDestroyed(this)).subscribe((obj) => { + if (obj) { + this.listen(); + } + }); + this.handleNotMintedWarning(); }); - this.handleNotMintedWarning(); } public handleFilterChange(filter: FilterOptions): void { diff --git a/src/app/pages/member/pages/transactions/transactions.page.ts b/src/app/pages/member/pages/transactions/transactions.page.ts index 3da8ef6..dd547e2 100644 --- a/src/app/pages/member/pages/transactions/transactions.page.ts +++ b/src/app/pages/member/pages/transactions/transactions.page.ts @@ -54,12 +54,12 @@ export class TransactionsPage implements OnInit, OnDestroy { this.exportTransactions(); this.cd.markForCheck(); } - }); - this.data.member$?.pipe(untilDestroyed(this)).subscribe((obj) => { - if (obj) { - this.listen(); - } + this.data.member$?.pipe(untilDestroyed(this)).subscribe((obj) => { + if (obj) { + this.listen(); + } + }); }); }