Skip to content

Commit

Permalink
fix: fix list bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwmt committed Oct 18, 2023
1 parent b16f09c commit 8bda79b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/app/ironman/ironman-store.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ export class IronmanStoreService {
tap(() => this.isLoading$.next(true)),
map((list: any) => {

console.log('author', decodeURI(author.toLocaleLowerCase()))

return list.filter((d: IronmanListInfo) => {
return d.author
.toLocaleLowerCase()
Expand Down
8 changes: 5 additions & 3 deletions src/app/ironman/list/list.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, DestroyRef, OnInit, inject } from '@angular/core';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Observable, combineLatest } from 'rxjs';
import { map, distinctUntilChanged } from 'rxjs/operators';
import { map, distinctUntilChanged, filter } from 'rxjs/operators';
import { IronmanStoreService } from '../ironman-store.service';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

Expand Down Expand Up @@ -71,9 +71,11 @@ export class ListComponent implements OnInit {
});

this.author$
.pipe(takeUntilDestroyed(this.destroyRef))
.pipe(
takeUntilDestroyed(this.destroyRef),
filter((author) => !!author)
)
.subscribe((author) => {
// console.log('sss', res)
this.ironmanStoreService.filterAuthor(author);
});
}
Expand Down
2 changes: 0 additions & 2 deletions src/app/ironman/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ export class SearchComponent implements OnInit {
}

onAuthorSearch(value: string): void {
console.log('onAuthorSearch', value);

this.router.navigate(['list'], {
queryParams: {
author: encodeURI(value),
Expand Down

0 comments on commit 8bda79b

Please sign in to comment.