Skip to content

Commit cdfee96

Browse files
committed
fix: fix mosts error
1 parent 59a34b1 commit cdfee96

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

src/app/mosts/contents/contents.component.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
<ng-template #loading>
2-
<div class="spinner-border" role="status"><span class="visually-hidden" i18n>Loading…</span></div>
3-
</ng-template>
4-
1+
asd
52
@if (ratingCatnameNormalized$ | async; as ratingCatname) {
63
<h1 class="mb-4 mosts-header" ngPreserveWhitespaces>
74
<span i18n>Most</span>

src/app/mosts/contents/contents.component.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
getUnitNameTranslation,
1010
getVehicleTypeRpTranslation,
1111
} from '@utils/translations';
12-
import {BehaviorSubject, combineLatest, EMPTY, Observable} from 'rxjs';
12+
import {BehaviorSubject, combineLatest, Observable} from 'rxjs';
1313
import {debounceTime, distinctUntilChanged, map, shareReplay, switchMap, tap} from 'rxjs/operators';
1414

1515
import {APIMostsItem, MostsService} from '../mosts.service';
@@ -65,7 +65,7 @@ export class MostsContentsComponent {
6565
private readonly menu$ = this.brandID$.pipe(
6666
distinctUntilChanged(),
6767
debounceTime(10),
68-
switchMap((brandID) => (brandID ? this.mostsService.getMenu$(brandID) : EMPTY)),
68+
switchMap((brandID) => this.mostsService.getMenu$(brandID || 0)),
6969
shareReplay(1),
7070
);
7171

@@ -91,14 +91,12 @@ export class MostsContentsComponent {
9191
switchMap(([ratingCatname, typeCatname, yearsCatname]) =>
9292
this.brandID$.pipe(
9393
switchMap((brandID) =>
94-
brandID
95-
? this.mostsService.getItems$({
96-
brand_id: brandID,
97-
rating_catname: ratingCatname,
98-
type_catname: typeCatname || '',
99-
years_catname: yearsCatname || '',
100-
})
101-
: EMPTY,
94+
this.mostsService.getItems$({
95+
brand_id: brandID || 0,
96+
rating_catname: ratingCatname,
97+
type_catname: typeCatname || '',
98+
years_catname: yearsCatname || '',
99+
}),
102100
),
103101
),
104102
),

0 commit comments

Comments
 (0)