diff --git a/CHANGELOG.md b/CHANGELOG.md index 7419b9db5..e4ae83249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed the missing currency conversion of the dividends on the analysis page +- Fixed the missing error state in the watchlist +- Fixed the missing loading indicator in the benchmarks of the markets overview ## 3.51.0 - 2026-08-14 diff --git a/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts b/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts index 97fa6f744..7492e4e92 100644 --- a/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts +++ b/apps/client/src/app/components/home-watchlist/home-watchlist.component.ts @@ -128,10 +128,17 @@ export class GfHomeWatchlistComponent implements OnInit { this.dataService .fetchWatchlist() .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe(({ watchlist }) => { - this.watchlist = watchlist; + .subscribe({ + error: () => { + this.watchlist = []; + + this.changeDetectorRef.markForCheck(); + }, + next: ({ watchlist }) => { + this.watchlist = watchlist ?? []; - this.changeDetectorRef.markForCheck(); + this.changeDetectorRef.markForCheck(); + } }); } diff --git a/apps/client/src/app/components/markets/markets.component.ts b/apps/client/src/app/components/markets/markets.component.ts index 7c69fede0..0317ce648 100644 --- a/apps/client/src/app/components/markets/markets.component.ts +++ b/apps/client/src/app/components/markets/markets.component.ts @@ -43,7 +43,7 @@ import { DeviceDetectorService } from 'ngx-device-detector'; templateUrl: './markets.html' }) export class GfMarketsComponent implements OnInit { - protected readonly benchmarks = signal([]); + protected readonly benchmarks = signal(undefined); protected readonly deviceType = computed( () => this.deviceDetectorService.deviceInfo().deviceType @@ -117,8 +117,13 @@ export class GfMarketsComponent implements OnInit { this.dataService .fetchBenchmarks() .pipe(takeUntilDestroyed(this.destroyRef)) - .subscribe(({ benchmarks }) => { - this.benchmarks.set(benchmarks); + .subscribe({ + error: () => { + this.benchmarks.set([]); + }, + next: ({ benchmarks }) => { + this.benchmarks.set(benchmarks ?? []); + } }); } diff --git a/apps/client/src/app/components/markets/markets.html b/apps/client/src/app/components/markets/markets.html index bd9013a00..d834dfd0e 100644 --- a/apps/client/src/app/components/markets/markets.html +++ b/apps/client/src/app/components/markets/markets.html @@ -56,7 +56,7 @@ [showSymbol]="false" [user]="user" /> - @if (benchmarks()?.length > 0) { + @if (benchmarks()?.length) {
diff --git a/libs/ui/src/lib/benchmark/benchmark.component.html b/libs/ui/src/lib/benchmark/benchmark.component.html index 296e0ce17..556b9875f 100644 --- a/libs/ui/src/lib/benchmark/benchmark.component.html +++ b/libs/ui/src/lib/benchmark/benchmark.component.html @@ -216,7 +216,7 @@
-@if (isLoading) { +@if (isLoading()) { (); + public readonly benchmarks = input(); public readonly deviceType = input.required(); public readonly hasPermissionToDeleteItem = input(); public readonly locale = input(getLocale()); @@ -76,6 +76,7 @@ export class GfBenchmarkComponent { protected readonly sort = viewChild(MatSort); protected readonly dataSource = new MatTableDataSource([]); + protected readonly displayedColumns = computed(() => { return [ ...(this.showIcon() ? ['icon'] : []), @@ -89,7 +90,11 @@ export class GfBenchmarkComponent { 'actions' ]; }); - protected isLoading = true; + + protected readonly isLoading = computed(() => { + return !this.benchmarks(); + }); + protected readonly isNumber = isNumber; protected readonly resolveMarketCondition = resolveMarketCondition; protected readonly round = round; @@ -110,8 +115,8 @@ export class GfBenchmarkComponent { this.dataSource.sortingDataAccessor = getLowercase; this.dataSource.sort = this.sort() ?? null; - - this.isLoading = false; + } else { + this.dataSource.data = []; } });